Merge remote-tracking branch 'origin/master' into vulkan

This commit is contained in:
Ivan Avdeev 2021-02-19 22:10:44 -08:00
commit fea484b946
232 changed files with 3442 additions and 3331 deletions

View File

@ -20,7 +20,7 @@ AllowShortLoopsOnASingleLine: false
NamespaceIndentation: Inner
SpaceAfterCStyleCast: false
SpaceBeforeParens: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: true
SpacesInAngles: true
SpacesInParentheses: true

4
.gitignore vendored
View File

@ -314,8 +314,8 @@ build-*
# Waf
build_current
\.?waf-*/
\.?waf3-*/
*waf-*/
*waf3-*/
.lock-waf*
*.lastbuildstate
*.unsuccessfulbuild

View File

@ -120,7 +120,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
89. [Gut Reaction](http://www.moddb.com/mods/gut-reaction)
90. [Half-Life C.A.G.E.D.](https://store.steampowered.com/app/679990/HalfLife_Caged/) (set **-num edicts 4096** in command-line parameters for successful start)
90. [Half-Life: Dreamcast v1.1](http://www.moddb.com/mods/half-life-dreamcast)
91. [Half-Life: OPS](http://www.dcfan.net.ru/forum/f109/half-life-ops-3791/) (link dead!)
91. [Half-Life: OPS](https://www.runthinkshootlive.com/posts/half-life-ops/)
92. [Half-Life: Uplink](https://www.fileplanet.com/10360/10000/fileinfo/Half-Life:-UpLink-Demo)
92. [Half-Quake](http://www.moddb.com/mods/halfquake-amen)
93. [Half-Quake 2: Amen](http://www.moddb.com/mods/halfquake-amen)
@ -206,7 +206,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
173. [Run for Life](https://www.runthinkshootlive.com/posts/run-for-life/) (the "stolen" version of this mod with changed menu background also known as *Mad Escape*)
174. [S.W.A.T.](http://www.moddb.com/mods/swat2)
175. [Sabotage](https://www.runthinkshootlive.com/posts/sabotage-2/)
176. [Sagharmath](http://hl.webz.cz/hl1/eng.php?what=rec&zkratka=sa) (link dead!)
176. [Sagharmath](https://www.moddb.com/games/half-life/addons/sagharmath)
177. [Sandscroll](https://gamebanana.com/maps/15988)
178. [Saving Bob](https://www.runthinkshootlive.com/posts/saving-bob/)
179. [Secret Base](https://www.runthinkshootlive.com/posts/secret-base/)
@ -217,12 +217,12 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
184. [Sky Mesa](http://www.moddb.com/mods/sky-mesa)
185. [Sleephorst v1.5](http://www.moddb.com/mods/sleephorst-v15)
186. [Smart Decoy](http://www.moddb.com/mods/smart-decoy)
187. [Somewhere in Time](http://twhl.info/vault.php?map=5530) (link dead!)
188. [Sooper 2](http://www.k-saz.freeserve.co.uk/projects.htm) (link dead!)
187. [Somewhere in Time](https://www.runthinkshootlive.com/posts/somewhere-in-time/)
188. [Sooper2](https://www.runthinkshootlive.com/posts/sooper-2/)
189. [Split-Second](http://twhl.info/vault.php?map=4343)
190. [Subhumanity](https://www.runthinkshootlive.com/posts/sub-humanity/)
191. [Terror Side](https://www.runthinkshootlive.com/posts/terror-side/) (set **sv_validate_changelevel** to **0** to avoid problem with level change between some maps)
192. [Test Your Skill](http://www.tys-mod.de.vu/&e=40455876) (link dead!)
192. [Test Your Skill](https://www.moddb.com/games/half-life/addons/test-your-skill)
193. [The Challenger Deep](https://www.runthinkshootlive.com/posts/challenger-deep/)
194. [The Challenger Deep 2](http://www.moddb.com/mods/the-challenger-deep-2)
195. [The Evil Thing](http://www.moddb.com/mods/the-evil-thing)
@ -287,7 +287,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
11. [HL Shadows, Part 1](https://www.fileplanet.com/7466/0/fileinfo/'HL-Shadows',-Part-1)
12. [HLNewEnd](http://twhl.info/vault.php?map=2275)
13. [Kleiners Adventures Demo](http://www.moddb.com/mods/kleiners-adventures)
14. [Kleiners Adventures: The White Line Demo](https://www.gamefront.com/files/13595030/Kleiners_Adventure_siemka321_edition) (link dead!)
14. [Kleiners Adventures: The White Line Demo](https://www.moddb.com/mods/kleiners-adventure-siemka321-edition)
15. [LV-426: Episode 1](https://www.runthinkshootlive.com/posts/lv426-version-a/)
16. [Malevolence(1.3 and older)](http://www.moddb.com/mods/malevolence)
17. [Meth-Life Demo v1.0](https://www.gamewatcher.com/mods/half-life-mod/meth-life-mod-demo-1-0)
@ -317,7 +317,7 @@ For mappacks - place *.bsp files to **valve/maps** folder, *.wad files to **valv
41. [Zombieland v1.1](http://www.moddb.com/mods/zombieland)
## Just mappacks
1. [AvsM 1 v1.2](http://www.moddb.com/mods/avsm-2-project-xen/downloads/avsm-1-v12-full-version-croeng) (link dead!)
1. [AvsM 1 v1.2](https://www.moddb.com/mods/avsm-1-2003-version-re-release/)
2. [Cook The Headcrab Episodes 1 & 2](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-series)
3. [Cook The Headcrab Episode 3](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-3)
4. [Cook The Headcrab Episode 4](http://www.moddb.com/games/half-life/addons/cook-the-headcrab-episode-4)
@ -422,7 +422,7 @@ Mods:
33. [C2](https://www.runthinkshootlive.com/posts/c2/)
34. [C3](https://www.runthinkshootlive.com/posts/c3/)
35. [C5](https://www.runthinkshootlive.com/posts/c5/)
36. [Caged](http://www.caylegeorge.com/ld_history/cg_maps.htm) (link dead!)
36. [Caged](https://store.steampowered.com/app/679990/HalfLife_Caged/)
37. [Camera Puzzle](http://twhl.info/vault.php?map=740) (this map perfectly demonstrates an improved feature of Xash3D Engine - game is correctly saving and restoring 3rd person view for the player after loading a previously saved game)
38. [CataXen](http://twhl.info/vault.php?map=3429)
39. [Cause of Death](http://twhl.info/competitions.php?results=7)
@ -641,7 +641,7 @@ Mods:
252. [Tower](http://twhl.info/vault.php?map=250) (Required Spirit of Half-Life for item_suit)
253. [TriggerHappy](https://www.fileplanet.com/8929/0/fileinfo/TriggerHappy)
254. [TriggerHappy2](https://www.fileplanet.com/13503/10000/fileinfo/TriggerHappy2)
255. [TriggerHappy2.5](http://www.atomicgamer.com/files/14120/trhappy25-zip) (link dead!)
255. [TriggerHappy2.5](https://www.moddb.com/games/half-life/addons/trigger-happy-v25)
256. [Trouble](https://gamebanana.com/maps/166033)
257. [Tunnels](http://twhl.info/vault.php?map=5350)
258. [Twisted Hazard Course](https://www.fileplanet.com/52919/50000/fileinfo/Twisted-Hazard-Course)
@ -708,7 +708,7 @@ For Linux and OS X you must download crossbuild from [here](http://www.moddb.com
16. [Radiation Alert: Episode 1 v1.1](http://www.moddb.com/mods/radiation-alert-episode-1)
17. [Run From Hell v1.1b](https://www.runthinkshootlive.com/posts/run-from-hell/) (there is an inner bug with underwater crates in the map **firstmap9** - they can't be broken, so you should use **noclip** to pass through them)
18. [Santa's Revenge](http://twhl.info/vault.php?map=4332) (set **fps_max** to **60** to avoid an inner problem of the last map with final scripted sequence, otherwise the mod can not be finished properly)
19. [Sector 6](http://www.moddb.com/mods/sector-6x) (link dead!)
19. [Sector 6](https://www.moddb.com/mods/sector-6/)
20. [Space Prisoner v1.1](http://www.moddb.com/games/half-life/addons/space-prisoner-v11) (after installing of the mod open **liblist.gam** or **gameinfo.txt** file in the mod's folder and correct the line **gamedll "..\prison\dlls\spirit.dll"** for **gamedll "dlls\spirit.dll"**, otherwise you'll not be able to start a game; there is also a scripting error on a third map of the mod, so you'll be forced to use **noclip** to pass around bugged place)
21. [Terrorist Attack 2](http://terroristattack.wz.cz/mody.html) (link dead!)
22. [Timeline III: The Heart of Darkness](http://www.moddb.com/mods/timeline-series)
@ -739,7 +739,7 @@ For Linux and OS X you must download crossbuild from [here](http://www.moddb.com
1. [Before v1.0](http://www.moddb.com/mods/half-life-before)
2. [Christmas Life v1.0](http://www.moddb.com/mods/christmas-life) (initial mod works properly, but additional mappacks for this mod contain few maps that have some gameplay problems under Xash3D)
3. [COLONY 42 Alpha](http://twhl.info/vault.php?map=6055)
4. [Crazy Crabs Demo 1 & 2](http://www.moddb.com/mods/mad-crabs-2014) (link dead!)
4. [Crazy Crabs Demo 1 & 2](https://www.moddb.com/mods/mad-crabs)
5. [Far Crab Demo v2](http://www.moddb.com/mods/far-crab)
6. [Firefighter Demo v1.1](http://www.moddb.com/mods/firefighter-mod)
7. [Halfquake 3: Sunrise](http://www.moddb.com/mods/halfquake-amen)
@ -780,7 +780,7 @@ For mappacks - place *.bsp files to **gearbox/maps** folder, *.wad files to **ge
16. [Mechanized Death: An Army of None](http://www.moddb.com/games/half-life-opposing-force/addons/mechanized-death-army-of-none)
17. [Nuclear Winter](http://www.moddb.com/mods/nuclear-winter-opfor)
18. [Opposing Force Aliens Addon](https://www.fileplanet.com/82829/80000/fileinfo/Half-Life:-Opposing-Force-Aliens-Addon-1.2)
19. [Opposing Life2Life](https://www.gamewatcher.com/) (link dead!)
19. [Opposing Life2Life](https://www.moddb.com/games/half-life/addons/opposing-life2life-final-hd)
20. [Realms](http://www.snarkpit.net/index.php?s=maps&map=3483)
21. [Shepard's Adventures](http://www.moddb.com/mods/shepards-adventures)
22. [Snowy Rock](http://www.moddb.com/games/half-life-opposing-force/addons/snow-rock)

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -48,7 +48,7 @@ BRUSH MODELS
#define SURF_PLANEBACK BIT( 1 ) // plane should be negated
#define SURF_DRAWSKY BIT( 2 ) // sky surface
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
#define SURF_DRAWTURB_QUADS BIT( 3 ) // all subidivided polygons are quads
#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)
@ -166,7 +166,7 @@ typedef struct
{
int id; // must be little endian XASH
int version;
dlump_t lumps[EXTRA_LUMPS];
dlump_t lumps[EXTRA_LUMPS];
} dextrahdr_t;
typedef struct

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -33,7 +33,7 @@ typedef struct
typedef struct
{
float prevanimtime;
float prevanimtime;
float sequencetime;
byte prevseqblending[2];
vec3_t prevorigin;

View File

@ -40,9 +40,9 @@ GNU General Public License for more details.
typedef enum
{
mod_bad = -1,
mod_brush,
mod_sprite,
mod_alias,
mod_brush,
mod_sprite,
mod_alias,
mod_studio
} modtype_t;
@ -93,7 +93,7 @@ typedef struct texture_s
struct texture_s *alternate_anims; // bmodels in frame 1 use these
unsigned short fb_texturenum; // auto-luma texturenum
unsigned short dt_texturenum; // detail-texture binding
unsigned int unused[3]; // reserved
unsigned int unused[3]; // reserved
} texture_t;
typedef struct
@ -147,7 +147,7 @@ typedef struct mnode_s
// node specific
mplane_t *plane;
struct mnode_s *children[2];
struct mnode_s *children[2];
#ifdef SUPPORT_BSP2_FORMAT
int firstsurface;
int numsurfaces;
@ -166,7 +166,7 @@ struct decal_s
decal_t *pnext; // linked list for each surface
msurface_t *psurface; // Surface id for persistence / unlinking
float dx; // local texture coordinates
float dy; //
float dy; //
float scale; // Pixel scale
short texture; // Decal texture
short flags; // Decal flags FDECAL_*
@ -299,7 +299,7 @@ typedef struct model_s
//
vec3_t mins, maxs; // bounding box at angles '0 0 0'
float radius;
// brush model
int firstmodelsurface;
int nummodelsurfaces;
@ -386,7 +386,7 @@ typedef struct player_info_s
int bottomcolor;
// last frame rendered
int renderframe;
int renderframe;
// Gait frame estimation
int gaitsequence;

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -123,41 +123,41 @@
// entity flags
#define EFLAG_SLERP 1 // do studio interpolation of this entity
//
// temp entity events
//
#define TE_BEAMPOINTS 0 // beam effect between two points
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (start position)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMENTPOINT 1 // beam effect between point and entity
// short (start entity)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// short (start entity)
// coord coord coord (end position)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_GUNSHOT 2 // particle effect plus ricochet sound
// coord coord coord (position)
// coord coord coord (position)
#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps
// coord coord coord (position)
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
@ -173,54 +173,54 @@
#define TE_EXPLFLAG_ROTATE 32 // rotate the sprite randomly
#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound
// coord coord coord (position)
// coord coord coord (position)
#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps
// coord coord coord (position)
// coord coord coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (framerate)
#define TE_TRACER 6 // tracer effect from point to point
// coord, coord, coord (start)
// coord, coord, coord (start)
// coord, coord, coord (end)
#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters
// coord, coord, coord (start)
// coord, coord, coord (end)
// byte (life in 0.1's)
// byte (width in 0.1's)
// coord, coord, coord (start)
// coord, coord, coord (end)
// byte (life in 0.1's)
// byte (width in 0.1's)
// byte (amplitude in 0.01's)
// short (sprite model index)
#define TE_BEAMENTS 8
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
#define TE_BEAMENTS 8
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite
// coord coord coord (position)
// coord coord coord (position)
#define TE_LAVASPLASH 10 // Quake1 lava splash
// coord coord coord (position)
// coord coord coord (position)
#define TE_TELEPORT 11 // Quake1 teleport splash
// coord coord coord (position)
// coord coord coord (position)
#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound
// coord coord coord (position)
// coord coord coord (position)
// byte (starting color)
// byte (num colors)
#define TE_BSPDECAL 13 // Decal from the .BSP file
#define TE_BSPDECAL 13 // Decal from the .BSP file
// coord, coord, coord (x,y,z), decal position (center of texture in world)
// short (texture index of precached decal texture name)
// short (entity index)
@ -230,67 +230,67 @@
// coord, coord, coord (position)
// byte (radius)
// byte (count)
// byte (life in 0.1's)
// byte (life in 0.1's)
#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions
// coord, coord, coord (start)
// coord, coord, coord (end)
// coord, coord, coord (start)
// coord, coord, coord (end)
// short (sprite index)
// byte (count)
// byte (life in 0.1's)
// byte (scale in 0.1's)
// byte (life in 0.1's)
// byte (scale in 0.1's)
// byte (velocity along vector in 10's)
// byte (randomness of velocity in 10's)
#define TE_BEAM 16 // obsolete
#define TE_SPRITE 17 // additive sprite, plays 1 cycle
// coord, coord, coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// coord, coord, coord (position)
// short (sprite index)
// byte (scale in 0.1's)
// byte (brightness)
#define TE_BEAMSPRITE 18 // A beam with a sprite at the end
// coord, coord, coord (start position)
// coord, coord, coord (end position)
// short (beam sprite index)
// short (end sprite index)
// coord, coord, coord (start position)
// coord, coord, coord (end position)
// short (beam sprite index)
// short (end sprite index)
#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// coord coord coord (center position)
// coord coord coord (axis and radius)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
@ -298,30 +298,30 @@
#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving
// short (entity:attachment to follow)
// short (sprite index)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte,byte,byte (color)
// byte (brightness)
#define TE_GLOWSPRITE 23
#define TE_GLOWSPRITE 23
// coord, coord, coord (pos) short (model index) byte (scale / 10)
#define TE_BEAMRING 24 // connect a beam ring to two entities
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// short (start entity)
// short (end entity)
// short (sprite index)
// byte (starting frame)
// byte (frame rate in 0.1's)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte (noise amplitude in 0.01's)
// byte,byte,byte (color)
// byte (brightness)
// byte (scroll speed in 0.1's)
#define TE_STREAK_SPLASH 25 // oriented shower of tracers
// coord coord coord (start position)
// coord coord coord (direction vector)
// coord coord coord (start position)
// coord coord coord (direction vector)
// byte (color)
// short (count)
// short (base speed)
@ -330,15 +330,15 @@
#define TE_BEAMHOSE 26 // obsolete
#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect
// coord, coord, coord (pos)
// byte (radius in 10's)
// coord, coord, coord (pos)
// byte (radius in 10's)
// byte byte byte (color)
// byte (life in 10's)
// byte (decay rate in 10's)
#define TE_ELIGHT 28 // point entity light, no world effect
// short (entity:attachment to follow)
// coord coord coord (initial position)
// coord coord coord (initial position)
// coord (radius)
// byte byte byte (color)
// byte (life in 0.1's)
@ -374,8 +374,8 @@
#define TE_LARGEFUNNEL 100
// coord coord coord (funnel position)
// short (sprite index)
// short (flags)
// short (sprite index)
// short (flags)
#define TE_BLOODSTREAM 101 // particle spray
// coord coord coord (start position)
@ -404,7 +404,7 @@
// byte (density)
#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits
// coord, coord, coord (position)
// coord, coord, coord (position)
// coord, coord, coord (velocity)
// angle (initial yaw)
// short (model index)
@ -441,7 +441,7 @@
// byte (speed)
// byte (noise)
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound.
// coord, coord, coord (position)
// byte (scale in 0.1's)
@ -529,7 +529,7 @@
#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance)
#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration.
#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube.
#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered as additive
#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent)
@ -620,7 +620,7 @@
#define CHAN_ITEM 3
#define CHAN_BODY 4
#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area
#define CHAN_STATIC 6 // allocate channel from the static area
#define CHAN_STATIC 6 // allocate channel from the static area
#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network
#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
@ -628,7 +628,7 @@
#define ATTN_NONE 0
#define ATTN_NORM (float)0.8
#define ATTN_IDLE (float)2
#define ATTN_STATIC (float)1.25
#define ATTN_STATIC (float)1.25
// pitch values
#define PITCH_NORM 100 // non-pitch shifted
@ -691,8 +691,8 @@
#define TE_BOUNCE_SHOTSHELL 2
// Rendering constants
enum
{
enum
{
kRenderNormal, // src
kRenderTransColor, // c*a+dest*(1-a)
kRenderTransTexture, // src*a+dest*(1-a)
@ -701,21 +701,21 @@ enum
kRenderTransAdd, // src*a+dest
};
enum
{
kRenderFxNone = 0,
kRenderFxPulseSlow,
kRenderFxPulseFast,
kRenderFxPulseSlowWide,
kRenderFxPulseFastWide,
kRenderFxFadeSlow,
kRenderFxFadeFast,
kRenderFxSolidSlow,
kRenderFxSolidFast,
kRenderFxStrobeSlow,
kRenderFxStrobeFast,
kRenderFxStrobeFaster,
kRenderFxFlickerSlow,
enum
{
kRenderFxNone = 0,
kRenderFxPulseSlow,
kRenderFxPulseFast,
kRenderFxPulseSlowWide,
kRenderFxPulseFastWide,
kRenderFxFadeSlow,
kRenderFxFadeFast,
kRenderFxSolidSlow,
kRenderFxSolidFast,
kRenderFxStrobeSlow,
kRenderFxStrobeFast,
kRenderFxStrobeFaster,
kRenderFxFlickerSlow,
kRenderFxFlickerFast,
kRenderFxNoDissipation,
kRenderFxDistort, // Distort/scale/translate flicker

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -32,7 +32,7 @@
#define FCVAR_CHANGED (1<<13) // set each time the cvar is changed
#define FCVAR_GAMEUIDLL (1<<14) // defined by the menu DLL
#define FCVAR_CHEAT (1<<15) // can not be changed if cheats are disabled
typedef struct cvar_s
{
char *name;

View File

@ -192,16 +192,4 @@ Default build-depended cvar and constant values
#define DEFAULT_FULLSCREEN 1
#endif // DEFAULT_FULLSCREEN
#ifndef DEFAULT_ACCELERATED_RENDERER
#if XASH_MOBILE_PLATFORM
#define DEFAULT_ACCELERATED_RENDERER "gles1"
#else // !XASH_MOBILE_PLATFORM
#define DEFAULT_ACCELERATED_RENDERER "gl"
#endif // !XASH_MOBILE_PLATFORM
#endif // DEFAULT_ACCELERATED_RENDERER
#ifndef DEFAULT_SOFTWARE_RENDERER
#define DEFAULT_SOFTWARE_RENDERER "soft" // mittorn's ref_soft
#endif // DEFAULT_SOFTWARE_RENDERER
#endif // DEFAULTS_H

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -17,7 +17,7 @@ GNU General Public License for more details.
#define FEATURES_H
// list of engine features that can be enabled through callback SV_CheckFeatures
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
#define ENGINE_WRITE_LARGE_COORD (1<<0) // replace standard message WRITE_COORD with big message for support more than 8192 units in world
#define ENGINE_QUAKE_COMPATIBLE (1<<1) // make engine compatible with quake (flags and effects)
#define ENGINE_LOAD_DELUXEDATA (1<<2) // loading deluxemap for map (if present)
#define ENGINE_PHYSICS_PUSHER_EXT (1<<3) // enable sets of improvements for MOVETYPE_PUSH physics

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -19,7 +19,7 @@
#define ENTITY_NORMAL (1<<0)
#define ENTITY_BEAM (1<<1)
// Entity state is used for the baseline and for delta compression of a packet of
// Entity state is used for the baseline and for delta compression of a packet of
// entities that is sent to a client.
typedef struct entity_state_s entity_state_t;
@ -63,36 +63,36 @@ struct entity_state_s
vec3_t velocity;
// Send bbox down to client for use during prediction.
vec3_t mins;
vec3_t mins;
vec3_t maxs;
int aiment;
// If owned by a player, the index of that player ( for projectiles ).
int owner;
int owner;
// Friction, for prediction.
float friction;
// Gravity multiplier
float gravity;
float gravity;
// PLAYER SPECIFIC
int team;
int playerclass;
int health;
qboolean spectator;
qboolean spectator;
int weaponmodel;
int gaitsequence;
// If standing on conveyor, e.g.
vec3_t basevelocity;
vec3_t basevelocity;
// Use the crouched hull, or the regular player hull.
int usehull;
int usehull;
// Latched buttons last time state updated.
int oldbuttons;
// -1 = in air, else pmove entity number
int onground;
int onground;
int iStepLeft;
// How fast we are falling
float flFallVelocity;
float flFallVelocity;
float fov;
int weaponanim;
@ -135,7 +135,7 @@ typedef struct clientdata_s
int bInDuck;
int weapons; // remove?
int flTimeStepSound;
int flDuckTime;
int flSwimTime;
@ -152,7 +152,7 @@ typedef struct clientdata_s
int ammo_cells;
int ammo_rockets;
float m_flNextAttack;
int tfstate;
int pushmsec;
int deadflag;

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -17,13 +17,13 @@
#define EVENT_FLAGS_H
// Skip local host for event send.
#define FEV_NOTHOST (1<<0)
#define FEV_NOTHOST (1<<0)
// Send the event reliably. You must specify the origin and angles and use
// PLAYBACK_EVENT_FULL for this to work correctly on the server for anything
// that depends on the event origin/angles. I.e., the origin/angles are not
// taken from the invoking edict for reliable events.
#define FEV_RELIABLE (1<<1)
#define FEV_RELIABLE (1<<1)
// Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC
// sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ).

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -23,7 +23,7 @@
// sub commands of svc_hltv:
#define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands
#define HLTV_STATUS 1 // send status infos about proxy
#define HLTV_STATUS 1 // send status infos about proxy
#define HLTV_LISTEN 2 // tell client to listen to a multicast stream
// sub commands of svc_director:
@ -45,7 +45,7 @@
// HLTV_EVENT event flags
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
#define DRC_FLAG_SIDE (1<<4) //
#define DRC_FLAG_SIDE (1<<4) //
#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -26,10 +26,10 @@ typedef enum
typedef struct IVoiceTweak_s
{
// These turn voice tweak mode on and off. While in voice tweak mode, the user's voice is echoed back
// without sending to the server.
// without sending to the server.
int (*StartVoiceTweakMode)( void ); // Returns 0 on error.
void (*EndVoiceTweakMode)( void );
// Get/set control values.
void (*SetControlFloat)( VoiceTweakControl iControl, float value );
float (*GetControlFloat)( VoiceTweakControl iControl );

View File

@ -1,6 +1,6 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
// Purpose:
//
// $NoKeywords: $
//=============================================================================

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -64,7 +64,7 @@ typedef struct net_response_s
typedef struct net_status_s
{
// Connected to remote server? 1 == yes, 0 otherwise
int connected;
int connected;
// Client's IP address
netadr_t local_address;
// Address of remote server

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -18,7 +18,7 @@
typedef enum
{
pt_static,
pt_static,
pt_grav,
pt_slowgrav,
pt_fire,
@ -45,7 +45,7 @@ typedef struct particle_s
// for pt_clientcusttom, we'll call this function each frame
void (*callback)( struct particle_s *particle, float frametime );
// For deathfunc, etc.
unsigned char context;
} particle_t;

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -33,7 +33,7 @@ struct pmtrace_s
vec3_t endpos; // final position
pmplane_t plane; // surface normal at impact
int ent; // entity at impact
vec3_t deltavelocity; // Change in player's velocity caused by impact.
vec3_t deltavelocity; // Change in player's velocity caused by impact.
// Only run on server.
int hitgroup;
};

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -17,7 +17,7 @@
#define R_EFX_H
// particle_t
#if !defined( PARTICLEDEFH )
#if !defined( PARTICLEDEFH )
#include "particledef.h"
#endif
@ -75,7 +75,7 @@ color24 gTracerColors[] =
#define FTENT_SPIRAL 0x00000400
#define FTENT_SPRCYCLE 0x00000800
#define FTENT_COLLIDEALL 0x00001000 // will collide with world and slideboxes
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
#define FTENT_PERSIST 0x00002000 // tent is not removed when unable to draw
#define FTENT_COLLIDEKILL 0x00004000 // tent is removed upon collision with anything
#define FTENT_PLYRATTACHMENT 0x00008000 // tent is attached to a player (owner)
#define FTENT_SPRANIMATELOOP 0x00010000 // animating sprite doesn't die when last frame is displayed
@ -102,7 +102,7 @@ typedef struct tempent_s
int priority;
short clientIndex; // if attached, this is the index of the client to stick to
// if COLLIDEALL, this is the index of the client to ignore
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
// TENTS with FTENT_PLYRATTACHMENT MUST set the clientindex!
vec3_t tentOffset; // if attached, client origin + tentOffset = tent origin.
cl_entity_t entity;

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -103,7 +103,7 @@ typedef struct engine_studio_api_s
// True if using D3D/OpenGL
int ( *IsHardware )( void );
// Only called by hardware interface
void ( *GL_StudioDrawShadow )( void );
void ( *GL_SetRenderMode )( int mode );
@ -140,7 +140,7 @@ typedef struct sv_blending_interface_s
{
int version;
void ( *SV_StudioSetupBones )( struct model_s *pModel,
void ( *SV_StudioSetupBones )( struct model_s *pModel,
float frame,
int sequence,
const vec3_t angles,

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -25,7 +25,7 @@ typedef struct ref_params_s
vec3_t forward;
vec3_t right;
vec3_t up;
// Client frametime;
float frametime;
// Client time
@ -54,7 +54,7 @@ typedef struct ref_params_s
int viewentity;
int playernum;
int max_entities;
int demoplayback;
int demoplayback;
int hardware;
int smoothing;

View File

@ -132,7 +132,7 @@ typedef struct modelstate_s
short frame; // 10 bits multiple by 4, should be enough
byte blending[2];
byte controller[4];
byte poseparam[16];
byte poseparam[16];
byte body;
byte skin;
short scale; // model scale (multiplied by 16)
@ -163,7 +163,7 @@ typedef struct render_api_s
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 );
lightstyle_t* (*GetLightStyle)( int number );
dlight_t* (*GetDynamicLight)( int number );
dlight_t* (*GetEntityLight)( int number );
byte (*LightToTexGamma)( byte color ); // software gamma support

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -16,7 +16,7 @@
#ifndef TRIANGLEAPI_H
#define TRIANGLEAPI_H
typedef enum
typedef enum
{
TRI_FRONT = 0,
TRI_NONE = 1,
@ -47,7 +47,7 @@ typedef struct triangleapi_s
void (*Vertex3fv)( const float *worldPnt );
void (*Vertex3f)( float x, float y, float z );
void (*Brightness)( float brightness );
void (*CullFace)( TRICULLSTYLE style );
void (*CullFace)( TRICULLSTYLE style );
int (*SpriteTexture)( struct model_s *pSpriteModel, int frame );
int (*WorldToScreen)( const float *world, float *screen ); // Returns 1 if it's z clipped
void (*Fog)( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b.

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -13,165 +13,165 @@
*
****/
{-0.525731, 0.000000, 0.850651},
{-0.442863, 0.238856, 0.864188},
{-0.295242, 0.000000, 0.955423},
{-0.309017, 0.500000, 0.809017},
{-0.162460, 0.262866, 0.951056},
{0.000000, 0.000000, 1.000000},
{0.000000, 0.850651, 0.525731},
{-0.147621, 0.716567, 0.681718},
{0.147621, 0.716567, 0.681718},
{0.000000, 0.525731, 0.850651},
{0.309017, 0.500000, 0.809017},
{0.525731, 0.000000, 0.850651},
{0.295242, 0.000000, 0.955423},
{0.442863, 0.238856, 0.864188},
{0.162460, 0.262866, 0.951056},
{-0.681718, 0.147621, 0.716567},
{-0.809017, 0.309017, 0.500000},
{-0.587785, 0.425325, 0.688191},
{-0.850651, 0.525731, 0.000000},
{-0.864188, 0.442863, 0.238856},
{-0.716567, 0.681718, 0.147621},
{-0.688191, 0.587785, 0.425325},
{-0.500000, 0.809017, 0.309017},
{-0.238856, 0.864188, 0.442863},
{-0.425325, 0.688191, 0.587785},
{-0.716567, 0.681718, -0.147621},
{-0.500000, 0.809017, -0.309017},
{-0.525731, 0.850651, 0.000000},
{0.000000, 0.850651, -0.525731},
{-0.238856, 0.864188, -0.442863},
{0.000000, 0.955423, -0.295242},
{-0.262866, 0.951056, -0.162460},
{0.000000, 1.000000, 0.000000},
{0.000000, 0.955423, 0.295242},
{-0.262866, 0.951056, 0.162460},
{0.238856, 0.864188, 0.442863},
{0.262866, 0.951056, 0.162460},
{0.500000, 0.809017, 0.309017},
{0.238856, 0.864188, -0.442863},
{0.262866, 0.951056, -0.162460},
{0.500000, 0.809017, -0.309017},
{0.850651, 0.525731, 0.000000},
{0.716567, 0.681718, 0.147621},
{0.716567, 0.681718, -0.147621},
{0.525731, 0.850651, 0.000000},
{0.425325, 0.688191, 0.587785},
{0.864188, 0.442863, 0.238856},
{0.688191, 0.587785, 0.425325},
{0.809017, 0.309017, 0.500000},
{0.681718, 0.147621, 0.716567},
{0.587785, 0.425325, 0.688191},
{0.955423, 0.295242, 0.000000},
{1.000000, 0.000000, 0.000000},
{0.951056, 0.162460, 0.262866},
{0.850651, -0.525731, 0.000000},
{0.955423, -0.295242, 0.000000},
{0.864188, -0.442863, 0.238856},
{0.951056, -0.162460, 0.262866},
{0.809017, -0.309017, 0.500000},
{0.681718, -0.147621, 0.716567},
{0.850651, 0.000000, 0.525731},
{0.864188, 0.442863, -0.238856},
{0.809017, 0.309017, -0.500000},
{0.951056, 0.162460, -0.262866},
{0.525731, 0.000000, -0.850651},
{0.681718, 0.147621, -0.716567},
{0.681718, -0.147621, -0.716567},
{0.850651, 0.000000, -0.525731},
{0.809017, -0.309017, -0.500000},
{0.864188, -0.442863, -0.238856},
{0.951056, -0.162460, -0.262866},
{0.147621, 0.716567, -0.681718},
{0.309017, 0.500000, -0.809017},
{0.425325, 0.688191, -0.587785},
{0.442863, 0.238856, -0.864188},
{0.587785, 0.425325, -0.688191},
{0.688191, 0.587785, -0.425325},
{-0.147621, 0.716567, -0.681718},
{-0.309017, 0.500000, -0.809017},
{0.000000, 0.525731, -0.850651},
{-0.525731, 0.000000, -0.850651},
{-0.442863, 0.238856, -0.864188},
{-0.295242, 0.000000, -0.955423},
{-0.162460, 0.262866, -0.951056},
{0.000000, 0.000000, -1.000000},
{0.295242, 0.000000, -0.955423},
{0.162460, 0.262866, -0.951056},
{-0.442863, -0.238856, -0.864188},
{-0.309017, -0.500000, -0.809017},
{-0.162460, -0.262866, -0.951056},
{0.000000, -0.850651, -0.525731},
{-0.147621, -0.716567, -0.681718},
{0.147621, -0.716567, -0.681718},
{0.000000, -0.525731, -0.850651},
{0.309017, -0.500000, -0.809017},
{0.442863, -0.238856, -0.864188},
{0.162460, -0.262866, -0.951056},
{0.238856, -0.864188, -0.442863},
{0.500000, -0.809017, -0.309017},
{0.425325, -0.688191, -0.587785},
{0.716567, -0.681718, -0.147621},
{0.688191, -0.587785, -0.425325},
{0.587785, -0.425325, -0.688191},
{0.000000, -0.955423, -0.295242},
{0.000000, -1.000000, 0.000000},
{0.262866, -0.951056, -0.162460},
{0.000000, -0.850651, 0.525731},
{0.000000, -0.955423, 0.295242},
{0.238856, -0.864188, 0.442863},
{0.262866, -0.951056, 0.162460},
{0.500000, -0.809017, 0.309017},
{0.716567, -0.681718, 0.147621},
{0.525731, -0.850651, 0.000000},
{-0.238856, -0.864188, -0.442863},
{-0.500000, -0.809017, -0.309017},
{-0.262866, -0.951056, -0.162460},
{-0.850651, -0.525731, 0.000000},
{-0.716567, -0.681718, -0.147621},
{-0.716567, -0.681718, 0.147621},
{-0.525731, -0.850651, 0.000000},
{-0.500000, -0.809017, 0.309017},
{-0.238856, -0.864188, 0.442863},
{-0.262866, -0.951056, 0.162460},
{-0.864188, -0.442863, 0.238856},
{-0.809017, -0.309017, 0.500000},
{-0.688191, -0.587785, 0.425325},
{-0.681718, -0.147621, 0.716567},
{-0.442863, -0.238856, 0.864188},
{-0.587785, -0.425325, 0.688191},
{-0.309017, -0.500000, 0.809017},
{-0.147621, -0.716567, 0.681718},
{-0.425325, -0.688191, 0.587785},
{-0.162460, -0.262866, 0.951056},
{0.442863, -0.238856, 0.864188},
{0.162460, -0.262866, 0.951056},
{0.309017, -0.500000, 0.809017},
{0.147621, -0.716567, 0.681718},
{0.000000, -0.525731, 0.850651},
{0.425325, -0.688191, 0.587785},
{0.587785, -0.425325, 0.688191},
{0.688191, -0.587785, 0.425325},
{-0.955423, 0.295242, 0.000000},
{-0.951056, 0.162460, 0.262866},
{-1.000000, 0.000000, 0.000000},
{-0.850651, 0.000000, 0.525731},
{-0.955423, -0.295242, 0.000000},
{-0.951056, -0.162460, 0.262866},
{-0.864188, 0.442863, -0.238856},
{-0.951056, 0.162460, -0.262866},
{-0.809017, 0.309017, -0.500000},
{-0.864188, -0.442863, -0.238856},
{-0.951056, -0.162460, -0.262866},
{-0.809017, -0.309017, -0.500000},
{-0.681718, 0.147621, -0.716567},
{-0.681718, -0.147621, -0.716567},
{-0.850651, 0.000000, -0.525731},
{-0.688191, 0.587785, -0.425325},
{-0.587785, 0.425325, -0.688191},
{-0.425325, 0.688191, -0.587785},
{-0.425325, -0.688191, -0.587785},
{-0.587785, -0.425325, -0.688191},
{-0.688191, -0.587785, -0.425325},
{-0.525731, 0.000000, 0.850651},
{-0.442863, 0.238856, 0.864188},
{-0.295242, 0.000000, 0.955423},
{-0.309017, 0.500000, 0.809017},
{-0.162460, 0.262866, 0.951056},
{0.000000, 0.000000, 1.000000},
{0.000000, 0.850651, 0.525731},
{-0.147621, 0.716567, 0.681718},
{0.147621, 0.716567, 0.681718},
{0.000000, 0.525731, 0.850651},
{0.309017, 0.500000, 0.809017},
{0.525731, 0.000000, 0.850651},
{0.295242, 0.000000, 0.955423},
{0.442863, 0.238856, 0.864188},
{0.162460, 0.262866, 0.951056},
{-0.681718, 0.147621, 0.716567},
{-0.809017, 0.309017, 0.500000},
{-0.587785, 0.425325, 0.688191},
{-0.850651, 0.525731, 0.000000},
{-0.864188, 0.442863, 0.238856},
{-0.716567, 0.681718, 0.147621},
{-0.688191, 0.587785, 0.425325},
{-0.500000, 0.809017, 0.309017},
{-0.238856, 0.864188, 0.442863},
{-0.425325, 0.688191, 0.587785},
{-0.716567, 0.681718, -0.147621},
{-0.500000, 0.809017, -0.309017},
{-0.525731, 0.850651, 0.000000},
{0.000000, 0.850651, -0.525731},
{-0.238856, 0.864188, -0.442863},
{0.000000, 0.955423, -0.295242},
{-0.262866, 0.951056, -0.162460},
{0.000000, 1.000000, 0.000000},
{0.000000, 0.955423, 0.295242},
{-0.262866, 0.951056, 0.162460},
{0.238856, 0.864188, 0.442863},
{0.262866, 0.951056, 0.162460},
{0.500000, 0.809017, 0.309017},
{0.238856, 0.864188, -0.442863},
{0.262866, 0.951056, -0.162460},
{0.500000, 0.809017, -0.309017},
{0.850651, 0.525731, 0.000000},
{0.716567, 0.681718, 0.147621},
{0.716567, 0.681718, -0.147621},
{0.525731, 0.850651, 0.000000},
{0.425325, 0.688191, 0.587785},
{0.864188, 0.442863, 0.238856},
{0.688191, 0.587785, 0.425325},
{0.809017, 0.309017, 0.500000},
{0.681718, 0.147621, 0.716567},
{0.587785, 0.425325, 0.688191},
{0.955423, 0.295242, 0.000000},
{1.000000, 0.000000, 0.000000},
{0.951056, 0.162460, 0.262866},
{0.850651, -0.525731, 0.000000},
{0.955423, -0.295242, 0.000000},
{0.864188, -0.442863, 0.238856},
{0.951056, -0.162460, 0.262866},
{0.809017, -0.309017, 0.500000},
{0.681718, -0.147621, 0.716567},
{0.850651, 0.000000, 0.525731},
{0.864188, 0.442863, -0.238856},
{0.809017, 0.309017, -0.500000},
{0.951056, 0.162460, -0.262866},
{0.525731, 0.000000, -0.850651},
{0.681718, 0.147621, -0.716567},
{0.681718, -0.147621, -0.716567},
{0.850651, 0.000000, -0.525731},
{0.809017, -0.309017, -0.500000},
{0.864188, -0.442863, -0.238856},
{0.951056, -0.162460, -0.262866},
{0.147621, 0.716567, -0.681718},
{0.309017, 0.500000, -0.809017},
{0.425325, 0.688191, -0.587785},
{0.442863, 0.238856, -0.864188},
{0.587785, 0.425325, -0.688191},
{0.688191, 0.587785, -0.425325},
{-0.147621, 0.716567, -0.681718},
{-0.309017, 0.500000, -0.809017},
{0.000000, 0.525731, -0.850651},
{-0.525731, 0.000000, -0.850651},
{-0.442863, 0.238856, -0.864188},
{-0.295242, 0.000000, -0.955423},
{-0.162460, 0.262866, -0.951056},
{0.000000, 0.000000, -1.000000},
{0.295242, 0.000000, -0.955423},
{0.162460, 0.262866, -0.951056},
{-0.442863, -0.238856, -0.864188},
{-0.309017, -0.500000, -0.809017},
{-0.162460, -0.262866, -0.951056},
{0.000000, -0.850651, -0.525731},
{-0.147621, -0.716567, -0.681718},
{0.147621, -0.716567, -0.681718},
{0.000000, -0.525731, -0.850651},
{0.309017, -0.500000, -0.809017},
{0.442863, -0.238856, -0.864188},
{0.162460, -0.262866, -0.951056},
{0.238856, -0.864188, -0.442863},
{0.500000, -0.809017, -0.309017},
{0.425325, -0.688191, -0.587785},
{0.716567, -0.681718, -0.147621},
{0.688191, -0.587785, -0.425325},
{0.587785, -0.425325, -0.688191},
{0.000000, -0.955423, -0.295242},
{0.000000, -1.000000, 0.000000},
{0.262866, -0.951056, -0.162460},
{0.000000, -0.850651, 0.525731},
{0.000000, -0.955423, 0.295242},
{0.238856, -0.864188, 0.442863},
{0.262866, -0.951056, 0.162460},
{0.500000, -0.809017, 0.309017},
{0.716567, -0.681718, 0.147621},
{0.525731, -0.850651, 0.000000},
{-0.238856, -0.864188, -0.442863},
{-0.500000, -0.809017, -0.309017},
{-0.262866, -0.951056, -0.162460},
{-0.850651, -0.525731, 0.000000},
{-0.716567, -0.681718, -0.147621},
{-0.716567, -0.681718, 0.147621},
{-0.525731, -0.850651, 0.000000},
{-0.500000, -0.809017, 0.309017},
{-0.238856, -0.864188, 0.442863},
{-0.262866, -0.951056, 0.162460},
{-0.864188, -0.442863, 0.238856},
{-0.809017, -0.309017, 0.500000},
{-0.688191, -0.587785, 0.425325},
{-0.681718, -0.147621, 0.716567},
{-0.442863, -0.238856, 0.864188},
{-0.587785, -0.425325, 0.688191},
{-0.309017, -0.500000, 0.809017},
{-0.147621, -0.716567, 0.681718},
{-0.425325, -0.688191, 0.587785},
{-0.162460, -0.262866, 0.951056},
{0.442863, -0.238856, 0.864188},
{0.162460, -0.262866, 0.951056},
{0.309017, -0.500000, 0.809017},
{0.147621, -0.716567, 0.681718},
{0.000000, -0.525731, 0.850651},
{0.425325, -0.688191, 0.587785},
{0.587785, -0.425325, 0.688191},
{0.688191, -0.587785, 0.425325},
{-0.955423, 0.295242, 0.000000},
{-0.951056, 0.162460, 0.262866},
{-1.000000, 0.000000, 0.000000},
{-0.850651, 0.000000, 0.525731},
{-0.955423, -0.295242, 0.000000},
{-0.951056, -0.162460, 0.262866},
{-0.864188, 0.442863, -0.238856},
{-0.951056, 0.162460, -0.262866},
{-0.809017, 0.309017, -0.500000},
{-0.864188, -0.442863, -0.238856},
{-0.951056, -0.162460, -0.262866},
{-0.809017, -0.309017, -0.500000},
{-0.681718, 0.147621, -0.716567},
{-0.681718, -0.147621, -0.716567},
{-0.850651, 0.000000, -0.525731},
{-0.688191, 0.587785, -0.425325},
{-0.587785, 0.425325, -0.688191},
{-0.425325, 0.688191, -0.587785},
{-0.425325, -0.688191, -0.587785},
{-0.587785, -0.425325, -0.688191},
{-0.688191, -0.587785, -0.425325},

View File

@ -1,9 +1,9 @@
/***
*
* 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.
*
* 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
@ -15,7 +15,7 @@
//
// cdll_int.h
//
// 4-23-98
// 4-23-98
// JOHN: client dll interface declarations
//
@ -205,11 +205,11 @@ typedef struct cl_enginefuncs_s
const struct model_s* (*GetSpritePointer)( HSPRITE hSprite );
void (*pfnPlaySoundByNameAtLocation)( char *szSound, float volume, float *origin );
unsigned short (*pfnPrecacheEvent)( int type, const char* psz );
void (*pfnPlaybackEvent)( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void (*pfnWeaponAnim)( int iAnim, int body );
float (*pfnRandomFloat)( float flLow, float flHigh );
float (*pfnRandomFloat)( float flLow, float flHigh );
int (*pfnRandomLong)( int lLow, int lHigh );
void (*pfnHookEvent)( const char *name, void ( *pfnEvent )( struct event_args_s *args ));
@ -229,12 +229,12 @@ typedef struct cl_enginefuncs_s
struct triangleapi_s *pTriAPI;
struct efx_api_s *pEfxAPI;
struct event_api_s *pEventAPI;
struct event_api_s *pEventAPI;
struct demo_api_s *pDemoAPI;
struct net_api_s *pNetAPI;
struct IVoiceTweak_s *pVoiceTweak;
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
// returns 1 if the client is a spectator only (connected to a proxy), 0 otherwise or 2 if in dev_overview mode
int (*IsSpectateOnly)( void );
struct model_s *(*LoadMapSprite)( const char *filename );

View File

@ -91,7 +91,7 @@ static dllfunc_t avifile_funcs[] =
};
dll_info_t avifile_dll = { "avifil32.dll", avifile_funcs, false };
typedef struct movie_state_s
{
qboolean active;
@ -423,7 +423,7 @@ int AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, int offset, int leng
result = 0;
// seek to correct chunk and all that stuff
if( !AVI_SeekPosition( Avi, offset ))
if( !AVI_SeekPosition( Avi, offset ))
return 0; // don't continue if we're waiting for the play pointer to catch up
while( length > 0 )
@ -535,7 +535,7 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
Avi->video_stream = Avi->audio_stream = NULL;
// open the streams until a stream is not available.
// open the streams until a stream is not available.
while( 1 )
{
PAVISTREAM stream = NULL;
@ -585,17 +585,17 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
}
else Avi->audio_bytes_per_sample = Avi->audio_header->nBlockAlign;
Avi->audio_length *= Avi->audio_bytes_per_sample;
}
}
else
{
pAVIStreamRelease( stream );
}
}
// display error message-stream not found.
// display error message-stream not found.
if( Avi->video_stream == NULL )
{
if( Avi->pfile ) // if file is open, close it
if( Avi->pfile ) // if file is open, close it
pAVIFileRelease( Avi->pfile );
if( !Avi->quiet )
Con_DPrintf( S_ERROR "couldn't find a valid video stream.\n" );
@ -613,9 +613,9 @@ void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audi
}
bmih.biSize = sizeof( BITMAPINFOHEADER );
bmih.biPlanes = 1;
bmih.biPlanes = 1;
bmih.biBitCount = 32;
bmih.biCompression = BI_RGB;
bmih.biCompression = BI_RGB;
bmih.biWidth = Avi->video_xres;
bmih.biHeight = -Avi->video_yres; // invert height to flip image upside down

View File

@ -127,7 +127,7 @@ void CL_PlayCDTrack_f( void )
for( maxTrack = i = 0; i < MAX_CDTRACKS; i++ )
if( COM_CheckStringEmpty( clgame.cdtracks[i] ) ) maxTrack++;
Con_Printf( "%u tracks\n", maxTrack );
if( track )
{
@ -140,11 +140,11 @@ void CL_PlayCDTrack_f( void )
else Con_Printf( "%s: unknown command %s\n", Cmd_Argv( 0 ), command );
}
/*
==================
/*
==================
CL_ScreenshotGetName
==================
*/
==================
*/
qboolean CL_ScreenshotGetName( int lastnum, char *filename )
{
if( lastnum < 0 || lastnum > 9999 )
@ -158,11 +158,11 @@ qboolean CL_ScreenshotGetName( int lastnum, char *filename )
return true;
}
/*
==================
/*
==================
CL_SnapshotGetName
==================
*/
==================
*/
qboolean CL_SnapshotGetName( int lastnum, char *filename )
{
if( lastnum < 0 || lastnum > 9999 )
@ -177,21 +177,21 @@ qboolean CL_SnapshotGetName( int lastnum, char *filename )
return true;
}
/*
==============================================================================
SCREEN SHOTS
==============================================================================
/*
==============================================================================
SCREEN SHOTS
==============================================================================
*/
/*
==================
/*
==================
CL_ScreenShot_f
normal screenshot
==================
==================
*/
void CL_ScreenShot_f( void )
void CL_ScreenShot_f( void )
{
int i;
string checkname;
@ -222,14 +222,14 @@ void CL_ScreenShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_SnapShot_f
save screenshots into root dir
==================
==================
*/
void CL_SnapShot_f( void )
void CL_SnapShot_f( void )
{
int i;
string checkname;
@ -263,12 +263,12 @@ void CL_SnapShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_EnvShot_f
cubemap view
==================
==================
*/
void CL_EnvShot_f( void )
{
@ -284,12 +284,12 @@ void CL_EnvShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_SkyShot_f
skybox view
==================
==================
*/
void CL_SkyShot_f( void )
{
@ -305,13 +305,13 @@ void CL_SkyShot_f( void )
cls.envshot_viewsize = 0;
}
/*
==================
/*
==================
CL_LevelShot_f
splash logo while map is loading
==================
*/
==================
*/
void CL_LevelShot_f( void )
{
size_t ft1, ft2;
@ -345,13 +345,13 @@ void CL_LevelShot_f( void )
else cls.scrshot_action = scrshot_inactive; // disable - not needs
}
/*
==================
/*
==================
CL_SaveShot_f
mini-pic in loadgame menu
==================
*/
==================
*/
void CL_SaveShot_f( void )
{
if( Cmd_Argc() < 2 )

View File

@ -41,7 +41,7 @@ qboolean CL_CheckFile( sizebuf_t *msg, resource_t *pResource )
if( pResource->type == t_sound )
Q_snprintf( filepath, sizeof( filepath ), DEFAULT_SOUNDPATH "%s", pResource->szFileName );
else Q_strncpy( filepath, pResource->szFileName, sizeof( filepath ));
if( !COM_IsSafeFileToDownload( filepath ))
{
Con_Reportf( "refusing to download %s\n", filepath );

View File

@ -97,7 +97,7 @@ typedef struct
typedef struct
{
oldcmd_t oldcmd[MSG_COUNT];
oldcmd_t oldcmd[MSG_COUNT];
int currentcmd;
qboolean parsing;
} msg_debug_t;
@ -155,7 +155,7 @@ void CL_Parse_RecordCommand( int cmd, int startoffset )
int slot;
if( cmd == svc_nop ) return;
slot = ( cls_message_debug.currentcmd++ & MSG_MASK );
cls_message_debug.oldcmd[slot].command = cmd;
cls_message_debug.oldcmd[slot].starting_offset = startoffset;
@ -187,7 +187,7 @@ write net_message into buffer.dat for debugging
static void CL_WriteErrorMessage( int current_count, sizebuf_t *msg )
{
const char *buffer_file = "buffer.dat";
file_t *fp;
file_t *fp;
fp = FS_Open( buffer_file, "wb", false );
if( !fp ) return;

View File

@ -156,7 +156,7 @@ CL_GetDemoRecordClock
write time while demo is recording
====================
*/
float CL_GetDemoRecordClock( void )
float CL_GetDemoRecordClock( void )
{
return cl.mtime[0];
}
@ -168,7 +168,7 @@ CL_GetDemoPlaybackClock
overwrite host.realtime
====================
*/
float CL_GetDemoPlaybackClock( void )
float CL_GetDemoPlaybackClock( void )
{
return host.realtime + host.frametime;
}
@ -353,7 +353,7 @@ void CL_WriteDemoHeader( const char *name )
int copysize;
int savepos;
int curpos;
Con_Printf( "recording to %s.\n", name );
cls.demofile = FS_Open( name, "wb", false );
cls.demotime = 0.0;
@ -467,7 +467,7 @@ void CL_StopRecord( void )
demo.header.directory_offset = curpos;
FS_Seek( cls.demofile, 0, SEEK_SET );
FS_Write( cls.demofile, &demo.header, sizeof( demo.header ));
FS_Close( cls.demofile );
cls.demofile = NULL;
cls.demorecording = false;
@ -726,9 +726,9 @@ qboolean CL_DemoMoveToNextSection( void )
// switch to next section, we got a dem_stop
demo.entry = &demo.directory.entries[demo.entryIndex];
// ready to continue reading, reset clock.
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET );
// time is now relative to this chunk's clock.
demo.starttime = CL_GetDemoPlaybackClock();
@ -739,7 +739,7 @@ qboolean CL_DemoMoveToNextSection( void )
qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
{
int msglen = 0;
int msglen = 0;
Assert( buffer != NULL );
Assert( length != NULL );
@ -795,8 +795,8 @@ qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
demoangle_t *a;
*length = 0; // assume we fail
// decide if it is time to grab the next message
// decide if it is time to grab the next message
if( cls.signon == SIGNONS ) // allways grab until fully connected
{
if( cls.timedemo )
@ -971,7 +971,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
}
} while( swallowmessages );
// If we are playing back a timedemo, and we've already passed on a
// If we are playing back a timedemo, and we've already passed on a
// frame update for this host_frame tag, then we'll just skip this message.
if( cls.timedemo && ( tdlastdemoframe == host.framecount ))
{
@ -993,7 +993,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
{
// cheat by moving the relative start time forward.
demo.starttime = CL_GetDemoPlaybackClock();
}
}
}
demo.framecount++;
@ -1101,9 +1101,9 @@ void CL_FinishTimeDemo( void )
{
int frames;
double time;
cls.timedemo = false;
// the first frame didn't count
frames = (host.framecount - cls.td_startframe) - 1;
time = host.realtime - cls.td_starttime;
@ -1151,7 +1151,7 @@ void CL_StopPlayback( void )
}
else
{
// let game known about demo state
// let game known about demo state
Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
cls.state = ca_disconnected;
memset( &cls.serveradr, 0, sizeof( cls.serveradr ) );
@ -1166,11 +1166,11 @@ void CL_StopPlayback( void )
}
}
/*
==================
/*
==================
CL_GetDemoComment
==================
*/
==================
*/
int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
{
file_t *demfile;
@ -1179,7 +1179,7 @@ int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
demoentry_t entry;
float playtime = 0.0f;
int i;
if( !comment ) return false;
demfile = FS_Open( demoname, "rb", false );
@ -1230,7 +1230,7 @@ int GAME_EXPORT CL_GetDemoComment( const char *demoname, char *comment )
// all done
FS_Close( demfile );
return true;
}
@ -1267,12 +1267,12 @@ qboolean CL_NextDemo( void )
return true;
}
/*
==================
/*
==================
CL_CheckStartupDemos
queue demos loop after movie playing
==================
==================
*/
void CL_CheckStartupDemos( void )
{
@ -1297,11 +1297,11 @@ void CL_CheckStartupDemos( void )
CL_NextDemo ();
}
/*
==================
/*
==================
CL_DemoGetName
==================
*/
==================
*/
static void CL_DemoGetName( int lastnum, char *filename )
{
if( lastnum < 0 || lastnum > 9999 )
@ -1387,7 +1387,7 @@ void CL_Record_f( void )
Q_strncpy( cls.demoname, demoname, sizeof( cls.demoname ));
Q_strncpy( gameui.globals->demoname, demoname, sizeof( gameui.globals->demoname ));
CL_WriteDemoHeader( demopath );
}

View File

@ -43,9 +43,9 @@ Call when removing an object from the world or moving it to another position
void R_RemoveEfrags( cl_entity_t *ent )
{
efrag_t *ef, *old, *walk, **prev;
ef = ent->efrag;
while( ef )
{
prev = &ef->leaf->efrags;
@ -55,22 +55,22 @@ void R_RemoveEfrags( cl_entity_t *ent )
if( !walk ) break;
if( walk == ef )
{
{
// remove this fragment
*prev = ef->leafnext;
break;
}
else prev = &walk->leafnext;
}
old = ef;
ef = ef->entnext;
// put it on the free list
old->entnext = clgame.free_efrags;
clgame.free_efrags = old;
}
ent->efrag = NULL;
ent->efrag = NULL;
}
/*
@ -83,10 +83,10 @@ static void R_SplitEntityOnNode( mnode_t *node )
efrag_t *ef;
mleaf_t *leaf;
int sides;
if( node->contents == CONTENTS_SOLID )
return;
// add an efrag if the node is a leaf
if( node->contents < 0 )
{
@ -105,29 +105,29 @@ static void R_SplitEntityOnNode( mnode_t *node )
clgame.free_efrags = ef->entnext;
ef->entity = r_addent;
// add the entity link
// add the entity link
*lastlink = ef;
lastlink = &ef->entnext;
ef->entnext = NULL;
// set the leaf links
ef->leaf = leaf;
ef->leafnext = leaf->efrags;
leaf->efrags = ef;
return;
}
// NODE_MIXED
sides = BOX_ON_PLANE_SIDE( r_emins, r_emaxs, node->plane );
if( sides == 3 )
{
// split on this plane
// if this is the first splitter of this bmodel, remember it
if( !r_pefragtopnode ) r_pefragtopnode = node;
}
// recurse down the contacted sides
if( sides & 1 ) R_SplitEntityOnNode( node->children[0] );
if( sides & 2 ) R_SplitEntityOnNode( node->children[1] );
@ -143,7 +143,7 @@ void R_AddEfrags( cl_entity_t *ent )
matrix3x4 transform;
vec3_t outmins, outmaxs;
int i;
if( !ent->model )
return;
@ -202,7 +202,7 @@ void R_StoreEfrags( efrag_t **ppefrag, int framecount )
ppefrag = &pefrag->leafnext;
break;
default:
default:
break;
}
}

View File

@ -134,7 +134,7 @@ CL_EventIndex
word CL_EventIndex( const char *name )
{
int i;
if( !COM_CheckString( name ))
return 0;
@ -189,7 +189,7 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
// get the func pointer
for( i = 0; i < MAX_EVENTS; i++ )
{
ev = clgame.events[i];
ev = clgame.events[i];
if( !ev )
{
@ -209,7 +209,7 @@ qboolean CL_FireEvent( event_info_t *ei, int slot )
name = cl.event_precache[ei->index];
Con_Reportf( S_ERROR "CL_FireEvent: %s not hooked\n", name );
break;
break;
}
}
@ -437,7 +437,7 @@ void CL_ParseEvent( sizebuf_t *msg )
args.angles[PITCH] /= -3.0f;
}
}
// Place event on queue
CL_QueueEvent( FEV_SERVER, event_index, delay, &args );
}
@ -469,7 +469,7 @@ void GAME_EXPORT CL_PlaybackEvent( int flags, const edict_t *pInvoker, word even
if( !CL_EventIndex( cl.event_precache[eventindex] ))
{
Con_DPrintf( S_ERROR "CL_PlaybackEvent: event %i was not precached\n", eventindex );
return;
return;
}
SetBits( flags, FEV_CLIENT ); // it's a client event

View File

@ -323,7 +323,7 @@ void CL_ProcessEntityUpdate( cl_entity_t *ent )
}
// g-cont. it should be done for all the players?
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
if( ent->player && !FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
ent->curstate.angles[PITCH] /= -3.0f;
VectorCopy( ent->curstate.origin, ent->origin );
@ -782,7 +782,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( subtracted >= CL_UPDATE_MASK )
{
{
// we can't use this, it is too old
Con_NPrintf( 2, "^3Warning:^1 delta frame is too old^7\n" );
CL_FlushEntityPacket( msg );
@ -850,7 +850,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
player = CL_IsPlayerIndex( newnum );
while( oldnum < newnum )
{
{
// one or more entities from the old packet are unchanged
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
oldindex++;
@ -867,7 +867,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( oldnum == newnum )
{
{
// delta from previous state
bufStart = MSG_GetNumBytesRead( msg );
CL_DeltaEntity( msg, newframe, newnum, oldent, true );
@ -887,7 +887,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
}
if( oldnum > newnum )
{
{
// delta from baseline ?
bufStart = MSG_GetNumBytesRead( msg );
CL_DeltaEntity( msg, newframe, newnum, NULL, true );
@ -898,7 +898,7 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
// any remaining entities in the old frame are copied over
while( oldnum != MAX_ENTNUMBER )
{
{
// one or more entities from the old packet are unchanged
CL_DeltaEntity( msg, newframe, oldnum, oldent, false );
oldindex++;
@ -928,10 +928,10 @@ int CL_ParsePacketEntities( sizebuf_t *msg, qboolean delta )
// first update is the final signon stage where we actually receive an entity (i.e., the world at least)
if( cls.signon == ( SIGNONS - 1 ))
{
{
// we are done with signon sequence.
cls.signon = SIGNONS;
// Clear loading plaque.
CL_SignonReply ();
}
@ -1224,7 +1224,7 @@ void CL_LinkPacketEntities( frame_t *frame )
if( ent->model->type == mod_studio )
{
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
if( interpolate && FBitSet( host.features, ENGINE_COMPUTE_STUDIO_LERP ))
ref.dllFuncs.R_StudioLerpMovement( ent, cl.time, ent->origin, ent->angles );
}
}

View File

@ -365,7 +365,7 @@ void CL_CenterPrint( const char *text, float y )
length++;
}
clgame.centerPrint.totalHeight = ( clgame.centerPrint.lines * clgame.scrInfo.iCharHeight );
clgame.centerPrint.totalHeight = ( clgame.centerPrint.lines * clgame.scrInfo.iCharHeight );
clgame.centerPrint.y = CL_AdjustYPos( y, clgame.centerPrint.totalHeight );
}
@ -503,7 +503,7 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
rc = *prc;
// Sigh! some stupid modmakers set wrong rectangles in hud.txt
// Sigh! some stupid modmakers set wrong rectangles in hud.txt
if( rc.left <= 0 || rc.left >= width ) rc.left = 0;
if( rc.top <= 0 || rc.top >= height ) rc.top = 0;
if( rc.right <= 0 || rc.right > width ) rc.right = width;
@ -563,7 +563,7 @@ void CL_DrawCenterPrint( void )
colorDefault = g_color_table[7];
pText = clgame.centerPrint.message;
Con_DrawCharacterLen( 0, NULL, &charHeight );
for( i = 0; i < clgame.centerPrint.lines; i++ )
{
lineLength = 0;
@ -612,7 +612,7 @@ void CL_DrawScreenFade( void )
// keep pushing reset time out indefinitely
if( sf->fadeFlags & FFADE_STAYOUT )
sf->fadeReset = cl.time + 0.1f;
if( sf->fadeReset == 0.0f && sf->fadeEnd == 0.0f )
return; // inactive
@ -652,7 +652,7 @@ void CL_DrawScreenFade( void )
CL_InitTitles
parse all messages that declared in titles.txt
and hold them into permament memory pool
and hold them into permament memory pool
====================
*/
static void CL_InitTitles( const char *filename )
@ -714,7 +714,7 @@ void CL_ParseTextMessage( sizebuf_t *msg )
{
channel = msgindex;
msgindex = (msgindex + 1) & (MAX_TEXTCHANNELS - 1);
}
}
// grab message channel
text = &cl_textmessage[channel];
@ -739,7 +739,7 @@ void CL_ParseTextMessage( sizebuf_t *msg )
else text->fxtime = 0.0f;
// to prevent grab too long messages
Q_strncpy( (char *)text->pMessage, MSG_ReadString( msg ), 2048 );
Q_strncpy( (char *)text->pMessage, MSG_ReadString( msg ), 2048 );
CL_HudMessage( text->pName );
}
@ -784,7 +784,7 @@ void CL_ParseFinaleCutscene( sizebuf_t *msg, int level )
text->fxtime = 0.0f;
// to prevent grab too long messages
Q_strncpy( (char *)text->pMessage, MSG_ReadString( msg ), 2048 );
Q_strncpy( (char *)text->pMessage, MSG_ReadString( msg ), 2048 );
if( *text->pMessage == '\0' )
return; // no real text
@ -978,7 +978,7 @@ static void CL_DrawLoadingOrPaused( qboolean paused, float percent )
right = (int)ceil( percent * step );
s2 = (float)right / width;
width = right;
ref.dllFuncs.Color4ub( 208, 152, 0, 255 );
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, s2, 1, cls.loadingBar );
@ -1047,7 +1047,7 @@ void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize )
Host_Error( "CL_LinkUserMessage: bad message name\n" );
if( svc_num <= svc_lastmsg )
Host_Error( "CL_LinkUserMessage: tried to hook a system message \"%s\"\n", svc_strings[svc_num] );
Host_Error( "CL_LinkUserMessage: tried to hook a system message \"%s\"\n", svc_strings[svc_num] );
// see if already hooked
for( i = 0; i < MAX_USER_MESSAGES && clgame.msg[i].name[0]; i++ )
@ -1062,7 +1062,7 @@ void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize )
}
}
if( i == MAX_USER_MESSAGES )
if( i == MAX_USER_MESSAGES )
{
Host_Error( "CL_LinkUserMessage: MAX_USER_MESSAGES hit!\n" );
return;
@ -1116,7 +1116,7 @@ void CL_InitEdicts( void )
if(( clgame.maxRemapInfos - 1 ) != clgame.maxEntities )
{
CL_ClearAllRemaps (); // purge old remap info
clgame.maxRemapInfos = clgame.maxEntities + 1;
clgame.maxRemapInfos = clgame.maxEntities + 1;
clgame.remap_info = (remap_info_t **)Mem_Calloc( clgame.mempool, sizeof( remap_info_t* ) * clgame.maxRemapInfos );
}
@ -1277,7 +1277,7 @@ static model_t *CL_LoadSpriteModel( const char *filename, uint type, uint texFla
for( i = 1, mod = clgame.sprites; i < MAX_CLIENT_SPRITES; i++, mod++ )
if( !mod->name[0] ) break; // this is a valid spot
if( i == MAX_CLIENT_SPRITES )
if( i == MAX_CLIENT_SPRITES )
{
Con_Printf( S_ERROR "MAX_CLIENT_SPRITES limit exceeded (%d)\n", MAX_CLIENT_SPRITES );
return NULL;
@ -1689,7 +1689,7 @@ static int GAME_EXPORT pfnHookUserMsg( const char *pszName, pfnUserMsgHook pfn )
// ignore blank names or invalid callbacks
if( !pszName || !*pszName || !pfn )
return 0;
return 0;
for( i = 0; i < MAX_USER_MESSAGES && clgame.msg[i].name[0]; i++ )
{
@ -1698,7 +1698,7 @@ static int GAME_EXPORT pfnHookUserMsg( const char *pszName, pfnUserMsgHook pfn )
return 1;
}
if( i == MAX_USER_MESSAGES )
if( i == MAX_USER_MESSAGES )
{
Host_Error( "HookUserMsg: MAX_USER_MESSAGES hit!\n" );
return 0;
@ -1750,7 +1750,7 @@ static int GAME_EXPORT pfnClientCmd( const char *szCmdString )
else
{
// will exec later
Q_strncat( host.deferred_cmd, va( "%s\n", szCmdString ), sizeof( host.deferred_cmd ));
Q_strncat( host.deferred_cmd, va( "%s\n", szCmdString ), sizeof( host.deferred_cmd ));
}
return 1;
@ -1779,7 +1779,7 @@ static void GAME_EXPORT pfnGetPlayerInfo( int ent_num, hud_player_info_t *pinfo
pinfo->thisplayer = ( ent_num == cl.playernum ) ? true : false;
pinfo->name = player->name;
pinfo->model = player->model;
pinfo->spectator = player->spectator;
pinfo->spectator = player->spectator;
pinfo->ping = player->ping;
pinfo->packetloss = player->packet_loss;
pinfo->topcolor = player->topcolor;
@ -1876,7 +1876,7 @@ static int GAME_EXPORT pfnDrawCharacter( int x, int y, int number, int r, int g,
=============
pfnDrawConsoleString
drawing string like a console string
drawing string like a console string
=============
*/
int GAME_EXPORT pfnDrawConsoleString( int x, int y, char *string )
@ -2143,7 +2143,7 @@ void GAME_EXPORT pfnCalcShake( void )
// Sine wave that slowly settles to zero
fraction = fraction * sin( cl.time * freq );
// add to view origin
VectorScale( clgame.shake.offset, fraction, clgame.shake.applied_offset );
@ -2166,7 +2166,7 @@ void GAME_EXPORT pfnApplyShake( float *origin, float *angles, float factor )
if( origin ) VectorMA( origin, factor, clgame.shake.applied_offset, origin );
if( angles ) angles[ROLL] += clgame.shake.applied_angle * factor;
}
/*
=============
pfnIsSpectateOnly
@ -2208,7 +2208,7 @@ static pmtrace_t *pfnTraceLine( float *start, float *end, int flags, int usehull
int old_usehull;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = usehull;
clgame.pmove->usehull = usehull;
switch( flags )
{
@ -2256,7 +2256,7 @@ static void GAME_EXPORT pfnHookEvent( const char *filename, pfnEventHook pfn )
// ignore blank names
if( !filename || !*filename )
return;
return;
Q_strncpy( name, filename, sizeof( name ));
COM_FixSlashes( name );
@ -2264,7 +2264,7 @@ static void GAME_EXPORT pfnHookEvent( const char *filename, pfnEventHook pfn )
// find an empty slot
for( i = 0; i < MAX_EVENTS; i++ )
{
ev = clgame.events[i];
ev = clgame.events[i];
if( !ev ) break;
if( !Q_stricmp( name, ev->name ) && ev->func != NULL )
@ -2391,7 +2391,7 @@ pfnLocalPlayerViewheight
*/
void GAME_EXPORT pfnLocalPlayerViewheight( float *view_ofs )
{
if( view_ofs ) VectorCopy( cl.viewheight, view_ofs );
if( view_ofs ) VectorCopy( cl.viewheight, view_ofs );
}
/*
@ -2537,7 +2537,7 @@ movevars_t *pfnGetMoveVars( void )
{
return &clgame.movevars;
}
/*
=============
pfnStopAllSounds
@ -3393,8 +3393,8 @@ void GAME_EXPORT NetAPI_SendRequest( int context, int request, int flags, double
nr->timeout = nr->timesend + timeout;
nr->pfnFunc = response;
nr->resp.context = context;
nr->resp.type = request;
nr->resp.remote_address = *remote_address;
nr->resp.type = request;
nr->resp.remote_address = *remote_address;
nr->flags = flags;
if( request == NETAPI_REQUEST_SERVERLIST )
@ -3583,7 +3583,7 @@ void GAME_EXPORT Voice_EndVoiceTweakMode( void )
Voice_SetControlFloat
=================
*/
*/
void GAME_EXPORT Voice_SetControlFloat( VoiceTweakControl iControl, float value )
{
}
@ -3604,7 +3604,7 @@ static void GAME_EXPORT VGui_ViewportPaintBackground( int extents[4] )
// stub
}
// shared between client and server
// shared between client and server
triangleapi_t gTriApi;
static efx_api_t gEfxApi =
@ -3752,7 +3752,7 @@ static IVoiceTweak gVoiceApi =
};
// engine callbacks
static cl_enginefunc_t gEngfuncs =
static cl_enginefunc_t gEngfuncs =
{
pfnSPR_Load,
pfnSPR_Frames,
@ -3970,7 +3970,7 @@ qboolean CL_LoadProgs( const char *name )
// trying to get single export
if(( GetClientAPI = (void *)COM_GetProcAddress( clgame.hInstance, "GetClientAPI" )) != NULL )
{
Con_Reportf( "CL_LoadProgs: found single callback export\n" );
Con_Reportf( "CL_LoadProgs: found single callback export\n" );
// trying to fill interface now
GetClientAPI( &clgame.dllFuncs );

View File

@ -306,7 +306,7 @@ static void GAME_EXPORT UI_DrawLogo( const char *filename, float x, float y, flo
{
string path;
const char *fullpath;
// run cinematic if not
Q_snprintf( path, sizeof( path ), "media/%s", filename );
COM_DefaultExtension( path, ".avi" );
@ -390,7 +390,7 @@ static void UI_UpdateUserinfo( void )
player->bottomcolor = Q_atoi( Info_ValueForKey( player->userinfo, "bottomcolor" ));
host.userinfo_changed = false; // we got it
}
void Host_Credits( void )
{
if( !gameui.hInstance ) return;
@ -776,7 +776,7 @@ static void GAME_EXPORT pfnDrawCharacter( int ix, int iy, int iwidth, int iheigh
=============
UI_DrawConsoleString
drawing string like a console string
drawing string like a console string
=============
*/
static int GAME_EXPORT UI_DrawConsoleString( int x, int y, const char *string )
@ -1046,7 +1046,7 @@ int GAME_EXPORT pfnCheckGameDll( void )
COM_FreeLibrary( hInst ); // don't increase linker's reference counter
return true;
}
Con_Reportf( S_WARN "Could not load server library:\n%s", COM_GetLibraryError() );
Con_Reportf( S_WARN "Could not load server library: %s\n", COM_GetLibraryError() );
return false;
}
@ -1108,7 +1108,7 @@ static void GAME_EXPORT UI_ShellExecute( const char *path, const char *parms, in
// engine callbacks
static ui_enginefuncs_t gEngfuncs =
static ui_enginefuncs_t gEngfuncs =
{
pfnPIC_Load,
GL_FreeImage,
@ -1149,7 +1149,7 @@ static ui_enginefuncs_t gEngfuncs =
Con_DefaultColor,
pfnGetPlayerModel,
pfnSetPlayerModel,
pfnClearScene,
pfnClearScene,
pfnRenderScene,
pfnAddEntity,
Host_Error,

View File

@ -184,17 +184,17 @@ void CL_CheckClientState( void )
{
// first update is the pre-final signon stage
if(( cls.state == ca_connected || cls.state == ca_validate ) && ( cls.signon == SIGNONS ))
{
{
cls.state = ca_active;
cls.changelevel = false; // changelevel is done
cls.changedemo = false; // changedemo is done
cl.first_frame = true; // first rendering frame
SCR_MakeLevelShot(); // make levelshot if needs
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
Cvar_SetValue( "scr_loading", 0.0f ); // reset progress bar
Netchan_ReportFlow( &cls.netchan );
Con_DPrintf( "client connected at %.2f sec\n", Sys_DoubleTime() - cls.timestart );
Con_DPrintf( "client connected at %.2f sec\n", Sys_DoubleTime() - cls.timestart );
if(( cls.demoplayback || cls.disable_servercount != cl.servercount ) && cl.video_prepped )
SCR_EndLoadingPlaque(); // get rid of loading plaque
}
@ -254,7 +254,7 @@ static float CL_LerpPoint( void )
float f, frac = 1.0f;
f = cl_serverframetime();
if( f == 0.0f || cls.timedemo )
{
cl.time = cl.mtime[0];
@ -262,7 +262,7 @@ static float CL_LerpPoint( void )
}
if( f > 0.1f )
{
{
// dropped packet, or start of demo
cl.mtime[1] = cl.mtime[0] - 0.1f;
f = 0.1f;
@ -372,7 +372,7 @@ void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
}
if( forced ) Cvar_SetValue( "ex_interp", (float)interpolation_msec * 0.001f );
interpolation_msec = bound( min_interp, interpolation_msec, max_interp );
interpolation_msec = bound( min_interp, interpolation_msec, max_interp );
cmd->lerp_msec = CL_DriftInterpolationAmount( interpolation_msec );
}
@ -637,7 +637,7 @@ void CL_CreateCmd( void )
CL_SetSolidPlayers( cl.playernum );
// message we are constructing.
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
pcmd = &cl.commands[i];
pcmd->processedfuncs = false;
@ -723,7 +723,7 @@ void CL_WritePacket( void )
int numcmds;
int newcmds;
int cmdnumber;
// don't send anything if playing back a demo
if( cls.demoplayback || cls.state < ca_connected || cls.state == ca_cinematic )
return;
@ -778,7 +778,7 @@ void CL_WritePacket( void )
if( send_command )
{
int outgoing_sequence;
if( cl_cmdrate->value > 0 ) // clamped between 10 and 100 fps
cls.nextcmdtime = host.realtime + bound( 0.1f, ( 1.0f / cl_cmdrate->value ), 0.01f );
else cls.nextcmdtime = host.realtime; // always able to send right away
@ -809,7 +809,7 @@ void CL_WritePacket( void )
// put an upper/lower bound on this
newcmds = bound( 0, newcmds, cls.legacymode?MAX_LEGACY_TOTAL_CMDS:MAX_TOTAL_CMDS );
if( cls.state == ca_connected ) newcmds = 0;
MSG_WriteByte( &buf, newcmds );
numcmds = newcmds + numbackup;
@ -833,7 +833,7 @@ void CL_WritePacket( void )
// message we are constructing.
i = cls.netchan.outgoing_sequence & CL_UPDATE_MASK;
// determine if we need to ask for a new set of delta's.
if( cl.validsequence && (cls.state == ca_active) && !( cls.demorecording && cls.demowaiting ))
{
@ -1240,7 +1240,7 @@ void CL_Connect_f( void )
else if( Cmd_Argc() != 2 )
{
Con_Printf( S_USAGE "connect <server>\n" );
return;
return;
}
Q_strncpy( server, Cmd_Argv( 1 ), sizeof( server ));
@ -1319,7 +1319,7 @@ void CL_Rcon_f( void )
NET_StringToAdr( rcon_address->string, &to );
if( to.port == 0 ) to.port = MSG_BigShort( PORT_SERVER );
}
NET_SendPacket( NS_CLIENT, Q_strlen( message ) + 1, message, to );
}
@ -1893,7 +1893,7 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
int len = sizeof( buf );
int dataoffset = 0;
netadr_t servadr;
MSG_Clear( msg );
MSG_ReadLong( msg ); // skip the -1
@ -2218,7 +2218,7 @@ void CL_ReadNetMessage( void )
continue;
}
// can't be a valid sequenced packet
// can't be a valid sequenced packet
if( cls.state < ca_connected ) continue;
if( !cls.demoplayback && MSG_GetMaxBytes( &net_message ) < 8 )
@ -2257,7 +2257,7 @@ void CL_ReadNetMessage( void )
MSG_Init( &net_message, "ServerData", net_message_buffer, curSize );
CL_ParseServerMessage( &net_message, false );
}
if( Netchan_CopyFileFragments( &cls.netchan, &net_message ))
{
// remove from resource request stuff.
@ -2333,7 +2333,7 @@ void CL_ReadPackets( void )
return;
}
}
}
/*
@ -2672,7 +2672,7 @@ qboolean CL_PrecacheResources( void )
}
else
{
Q_strncpy( cl.sound_precache[pRes->nIndex], pRes->szFileName, sizeof( cl.sound_precache[0] ));
Q_strncpy( cl.sound_precache[pRes->nIndex], pRes->szFileName, sizeof( cl.sound_precache[0] ));
cl.sound_index[pRes->nIndex] = S_RegisterSound( pRes->szFileName );
if( !cl.sound_index[pRes->nIndex] )
@ -2814,7 +2814,7 @@ void CL_InitLocal( void )
cl_nodelta = Cvar_Get ("cl_nodelta", "0", 0, "disable delta-compression for server messages" );
cl_idealpitchscale = Cvar_Get( "cl_idealpitchscale", "0.8", 0, "how much to look up/down slopes and stairs when not using freelook" );
cl_solid_players = Cvar_Get( "cl_solid_players", "1", 0, "Make all players not solid (can't traceline them)" );
cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE, "Interpolate object positions starting this many seconds in past" );
cl_interp = Cvar_Get( "ex_interp", "0.1", FCVAR_ARCHIVE, "Interpolate object positions starting this many seconds in past" );
cl_timeout = Cvar_Get( "cl_timeout", "60", 0, "connect timeout (in-seconds)" );
cl_charset = Cvar_Get( "cl_charset", "utf-8", FCVAR_ARCHIVE, "1-byte charset to use (iconv style)" );
hud_utf8 = Cvar_Get( "hud_utf8", "0", FCVAR_ARCHIVE, "Use utf-8 encoding for hud text" );
@ -2874,7 +2874,7 @@ void CL_InitLocal( void )
Cmd_AddCommand ("god", NULL, "enable godmode" );
Cmd_AddCommand ("fov", NULL, "set client field of view" );
Cmd_AddCommand ("log", NULL, "logging server events" );
// register our commands
Cmd_AddCommand ("pause", NULL, "pause the game (if the server allows pausing)" );
Cmd_AddCommand ("localservers", CL_LocalServers_f, "collect info about local servers" );
@ -2901,7 +2901,7 @@ void CL_InitLocal( void )
Cmd_AddCommand ("linefile", CL_ReadLineFile_f, "show leaks on a map (if present of course)" );
Cmd_AddCommand ("fullserverinfo", CL_FullServerinfo_f, "sent by server when serverinfo changes" );
Cmd_AddCommand ("upload", CL_BeginUpload_f, "uploading file to the server" );
Cmd_AddCommand ("quit", CL_Quit_f, "quit from game" );
Cmd_AddCommand ("exit", CL_Quit_f, "quit from game" );

View File

@ -16,9 +16,11 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#if XASH_LOW_MEMORY
#if XASH_LOW_MEMORY == 0
#define NET_TIMINGS 1024
#else
#elif XASH_LOW_MEMORY == 1
#define NET_TIMINGS 256
#elif XASH_LOW_MEMORY == 2
#define NET_TIMINGS 64
#endif
#define NET_TIMINGS_MASK (NET_TIMINGS - 1)
@ -116,33 +118,33 @@ void NetGraph_InitColors( void )
byte mincolor[2][3];
byte maxcolor[2][3];
float dc[2][3];
int i, hfrac;
int i, hfrac;
float f;
mincolor[0][0] = 63;
mincolor[0][1] = 0;
mincolor[0][2] = 100;
maxcolor[0][0] = 0;
maxcolor[0][1] = 63;
maxcolor[0][2] = 255;
mincolor[1][0] = 255;
mincolor[1][1] = 127;
mincolor[1][2] = 0;
maxcolor[1][0] = 250;
maxcolor[1][1] = 0;
maxcolor[1][2] = 0;
for( i = 0; i < 3; i++ )
{
dc[0][i] = (float)(maxcolor[0][i] - mincolor[0][i]);
dc[1][i] = (float)(maxcolor[1][i] - mincolor[1][i]);
}
hfrac = NETGRAPH_LERP_HEIGHT / 3;
for( i = 0; i < NETGRAPH_LERP_HEIGHT; i++ )
{
if( i < hfrac )

View File

@ -61,7 +61,7 @@ void CL_ParseSoundPacket( sizebuf_t *msg )
{
vec3_t pos;
int chan, sound;
float volume, attn;
float volume, attn;
int flags, pitch, entnum;
sound_t handle = 0;
@ -75,14 +75,14 @@ void CL_ParseSoundPacket( sizebuf_t *msg )
if( FBitSet( flags, SND_ATTENUATION ))
attn = (float)MSG_ReadByte( msg ) / 64.0f;
else attn = ATTN_NONE;
else attn = ATTN_NONE;
if( FBitSet( flags, SND_PITCH ))
pitch = MSG_ReadByte( msg );
else pitch = PITCH_NORM;
// entity reletive
entnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
entnum = MSG_ReadUBitLong( msg, MAX_ENTITY_BITS );
// positioned in space
MSG_ReadVec3Coord( msg, pos );
@ -123,7 +123,7 @@ void CL_ParseRestoreSoundPacket( sizebuf_t *msg )
{
vec3_t pos;
int chan, sound;
float volume, attn;
float volume, attn;
int flags, pitch, entnum;
double samplePos, forcedEnd;
int wordIndex;
@ -139,7 +139,7 @@ void CL_ParseRestoreSoundPacket( sizebuf_t *msg )
if( flags & SND_ATTENUATION )
attn = (float)MSG_ReadByte( msg ) / 64.0f;
else attn = ATTN_NONE;
else attn = ATTN_NONE;
if( flags & SND_PITCH )
pitch = MSG_ReadByte( msg );
@ -269,8 +269,8 @@ void CL_ParseParticles( sizebuf_t *msg )
vec3_t org, dir;
int i, count, color;
float life;
MSG_ReadVec3Coord( msg, org );
MSG_ReadVec3Coord( msg, org );
for( i = 0; i < 3; i++ )
dir[i] = MSG_ReadChar( msg ) * 0.0625f;
@ -907,7 +907,7 @@ void CL_ParseServerData( sizebuf_t *msg )
}
// multiplayer game?
if( cl.maxclients > 1 )
if( cl.maxclients > 1 )
{
// allow console in multiplayer games
host.allow_console = true;
@ -933,7 +933,7 @@ void CL_ParseServerData( sizebuf_t *msg )
Cvar_FullSet( "cl_background", "1", FCVAR_READ_ONLY );
else Cvar_FullSet( "cl_background", "0", FCVAR_READ_ONLY );
if( !cls.changelevel )
if( !cls.changelevel )
{
// continue playing if we are changing level
S_StopBackgroundTrack ();
@ -964,7 +964,7 @@ void CL_ParseServerData( sizebuf_t *msg )
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
{
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
Cvar_Set( "cl_levelshot_name", "*black" ); // render a black screen
cls.scrshot_request = scrshot_plaque; // request levelshot even if exist (check filetime)
}
@ -1024,7 +1024,7 @@ void CL_ParseClientData( sizebuf_t *msg )
frame = &cl.frames[cl.parsecountmod]; // frame at index.
frame->time = cl.mtime[0]; // mark network received time
frame->receivedtime = host.realtime; // time now that we are parsing.
frame->receivedtime = host.realtime; // time now that we are parsing.
memset( &frame->graphdata, 0, sizeof( netbandwidthgraph_t ));
@ -1032,7 +1032,7 @@ void CL_ParseClientData( sizebuf_t *msg )
parsecounttime = cl.commands[command_ack & CL_UPDATE_MASK].senttime;
// current time that we got a response to the command packet.
cl.commands[command_ack & CL_UPDATE_MASK].receivedtime = host.realtime;
cl.commands[command_ack & CL_UPDATE_MASK].receivedtime = host.realtime;
if( cl.last_command_ack != -1 )
{
@ -1088,8 +1088,8 @@ void CL_ParseClientData( sizebuf_t *msg )
// otherwise, move in 1 ms steps toward observed channel latency.
if( latency < cls.latency )
cls.latency = latency;
else cls.latency += 0.001f; // drift up, so corrections are needed
}
else cls.latency += 0.001f; // drift up, so corrections are needed
}
}
else
{
@ -1101,7 +1101,7 @@ void CL_ParseClientData( sizebuf_t *msg )
{
cl.local.health = 1;
return;
}
}
to_cd = &frame->clientdata;
to_wd = frame->weapondata;
@ -1228,13 +1228,13 @@ void CL_ParseAddAngle( sizebuf_t *msg )
{
pred_viewangle_t *a;
float delta_yaw;
delta_yaw = MSG_ReadBitAngle( msg, 16 );
#if 0
cl.viewangles[YAW] += delta_yaw;
return;
#endif
// update running counter
// update running counter
cl.addangletotal += delta_yaw;
// select entry into circular buffer
@ -1298,7 +1298,7 @@ void CL_RegisterUserMessage( sizebuf_t *msg )
{
char *pszName;
int svc_num, size, bits;
svc_num = MSG_ReadByte( msg );
if( cls.legacymode )
@ -1452,7 +1452,7 @@ void CL_UpdateUserPings( sizebuf_t *msg )
{
int i, slot;
player_info_t *player;
for( i = 0; i < MAX_CLIENTS; i++ )
{
if( !MSG_ReadOneBit( msg )) break; // end of message
@ -1918,7 +1918,7 @@ void CL_ParseCvarValue2( sizebuf_t *msg )
if( cvar->value != Q_atof( cvar->string ))
MSG_WriteString( &cls.netchan.message, va( "%s (%g)", cvar->string, cvar->value ));
else MSG_WriteString( &cls.netchan.message, cvar->string );
}
}
else
{
MSG_WriteString( &cls.netchan.message, "Not Found" );
@ -2081,7 +2081,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
// assume no entity/player update this packet
if( cls.state == ca_active )
{
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].choked = false;
}
else
@ -2089,7 +2089,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
CL_ResetFrame( &cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK] );
}
}
// parse the message
while( 1 )
{
@ -2104,7 +2104,7 @@ void CL_ParseServerMessage( sizebuf_t *msg, qboolean normal_message )
// end of message (align bits)
if( MSG_GetNumBitsLeft( msg ) < 8 )
break;
break;
cmd = MSG_ReadServerCmd( msg );

View File

@ -159,7 +159,7 @@ void CL_SetIdealPitch( void )
top[0] = cl.simorg[0] + cosval * (i + 3.0f) * 12.0f;
top[1] = cl.simorg[1] + sinval * (i + 3.0f) * 12.0f;
top[2] = cl.simorg[2] + cl.viewheight[2];
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2] - 160.0f;
@ -170,10 +170,10 @@ void CL_SetIdealPitch( void )
if( tr.fraction == 1.0f )
return; // near a dropoff
z[i] = top[2] + tr.fraction * (bottom[2] - top[2]);
}
dir = 0;
steps = 0;
@ -186,16 +186,16 @@ void CL_SetIdealPitch( void )
if( dir && ( step-dir > ON_EPSILON || step-dir < -ON_EPSILON ))
return; // mixed changes
steps++;
steps++;
dir = step;
}
if( !dir )
{
cl.local.idealpitch = 0.0f;
return;
}
if( steps < 2 ) return;
cl.local.idealpitch = -dir * cl_idealpitchscale->value;
}
@ -627,7 +627,7 @@ int GAME_EXPORT CL_WaterEntity( const float *rgflPos )
if( FBitSet( pe->model->flags, MODEL_HAS_ORIGIN ) && !VectorIsNull( pe->angles ))
{
matrix4x4 matrix;
Matrix4x4_CreateFromEntity( matrix, pe->angles, offset, 1.0f );
Matrix4x4_VectorITransform( matrix, rgflPos, test );
}
@ -655,7 +655,7 @@ pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags )
pmtrace_t tr;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = 2;
clgame.pmove->usehull = 2;
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numphysent, clgame.pmove->physents, -1, NULL );
clgame.pmove->usehull = old_usehull;
@ -675,7 +675,7 @@ pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags )
static pmtrace_t tr;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = 2;
clgame.pmove->usehull = 2;
tr = PM_PlayerTraceExt( clgame.pmove, start, end, flags, clgame.pmove->numvisent, clgame.pmove->visents, -1, NULL );
clgame.pmove->usehull = old_usehull;
@ -761,7 +761,7 @@ pmtrace_t *PM_TraceLine( float *start, float *end, int flags, int usehull, int i
int old_usehull;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = usehull;
clgame.pmove->usehull = usehull;
switch( flags )
{
@ -838,7 +838,7 @@ static const char *pfnTraceTexture( int ground, float *vstart, float *vend )
pe = &clgame.pmove->physents[ground];
return PM_TraceTexture( pe, vstart, vend );
}
}
static void GAME_EXPORT pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )
{
@ -870,7 +870,7 @@ static pmtrace_t *pfnTraceLineEx( float *start, float *end, int flags, int usehu
int old_usehull;
old_usehull = clgame.pmove->usehull;
clgame.pmove->usehull = usehull;
clgame.pmove->usehull = usehull;
switch( flags )
{
@ -926,13 +926,13 @@ void CL_InitClientMove( void )
clgame.pmove->PM_StuckTouch = pfnStuckTouch;
clgame.pmove->PM_PointContents = pfnPointContents;
clgame.pmove->PM_TruePointContents = pfnTruePointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_HullPointContents = pfnHullPointContents;
clgame.pmove->PM_PlayerTrace = pfnPlayerTrace;
clgame.pmove->PM_TraceLine = PM_TraceLine;
clgame.pmove->RandomLong = COM_RandomLong;
clgame.pmove->RandomFloat = COM_RandomFloat;
clgame.pmove->PM_GetModelType = pfnGetModelType;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_GetModelBounds = pfnGetModelBounds;
clgame.pmove->PM_HullForBsp = (void*)pfnHullForBsp;
clgame.pmove->PM_TraceModel = pfnTraceModel;
clgame.pmove->COM_FileSize = COM_FileSize;
@ -1019,7 +1019,7 @@ void CL_SetupPMove( playermove_t *pmove, local_state_t *from, usercmd_t *ucmd, q
VectorCopy( cd->vuser2, pmove->vuser2 );
VectorCopy( cd->vuser3, pmove->vuser3 );
VectorCopy( cd->vuser4, pmove->vuser4 );
pmove->cmd = *ucmd; // copy current cmds
pmove->cmd = *ucmd; // copy current cmds
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
}

View File

@ -224,7 +224,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
}
// multiplayer game?
if( cl.maxclients > 1 )
if( cl.maxclients > 1 )
{
// allow console in multiplayer games
host.allow_console = true;
@ -308,7 +308,7 @@ static void CL_ParseQuakeServerInfo( sizebuf_t *msg )
if(( cl_allow_levelshots->value && !cls.changelevel ) || cl.background )
{
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
if( !FS_FileExists( va( "%s.bmp", cl_levelshot_name->string ), true ))
Cvar_Set( "cl_levelshot_name", "*black" ); // render a black screen
cls.scrshot_request = scrshot_plaque; // request levelshot even if exist (check filetime)
}
@ -353,7 +353,7 @@ static void CL_ParseQuakeClientData( sizebuf_t *msg )
cl.parsecountmod = cl.parsecount & CL_UPDATE_MASK; // index into window.
frame = &cl.frames[cl.parsecountmod]; // frame at index.
frame->time = cl.mtime[0]; // mark network received time
frame->receivedtime = host.realtime; // time now that we are parsing.
frame->receivedtime = host.realtime; // time now that we are parsing.
memset( &frame->graphdata, 0, sizeof( netbandwidthgraph_t ));
memset( frame->flags, 0, sizeof( frame->flags ));
frame->first_entity = cls.next_client_entities;
@ -448,7 +448,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
SetBits( bits, i << 8 );
}
if( FBitSet( bits, U_LONGENTITY ))
if( FBitSet( bits, U_LONGENTITY ))
newnum = MSG_ReadWord( msg );
else newnum = MSG_ReadByte( msg );
@ -465,7 +465,7 @@ void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
if( ent->curstate.msg_time != cl.mtime[1] )
forcelink = true; // no previous frame to lerp from
else forcelink = false;
if( FBitSet( bits, U_MODEL ))
state->modelindex = MSG_ReadByte( msg );
else state->modelindex = ent->baseline.modelindex;
@ -573,8 +573,8 @@ void CL_ParseQuakeParticle( sizebuf_t *msg )
{
int count, color;
vec3_t org, dir;
MSG_ReadVec3Coord( msg, org );
MSG_ReadVec3Coord( msg, org );
dir[0] = MSG_ReadChar( msg ) * 0.0625f;
dir[1] = MSG_ReadChar( msg ) * 0.0625f;
dir[2] = MSG_ReadChar( msg ) * 0.0625f;
@ -597,12 +597,12 @@ void CL_ParseQuakeStaticSound( sizebuf_t *msg )
float vol, attn;
vec3_t org;
MSG_ReadVec3Coord( msg, org );
MSG_ReadVec3Coord( msg, org );
sound_num = MSG_ReadByte( msg );
vol = (float)MSG_ReadByte( msg ) / 255.0f;
attn = (float)MSG_ReadByte( msg ) / 64.0f;
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
S_StartSound( org, 0, CHAN_STATIC, cl.sound_index[sound_num], vol, attn, PITCH_NORM, 0 );
}
/*
@ -908,7 +908,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
// assume no entity/player update this packet
if( cls.state == ca_active )
{
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].valid = false;
cl.frames[cls.netchan.incoming_sequence & CL_UPDATE_MASK].choked = false;
}
else
@ -931,7 +931,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg, qboolean normal_message )
// end of message (align bits)
if( MSG_GetNumBitsLeft( msg ) < 8 )
break;
break;
cmd = MSG_ReadServerCmd( msg );

View File

@ -54,7 +54,7 @@ qboolean CL_CmpStudioTextures( int numtexs, mstudiotexture_t *p1, mstudiotexture
if( p1->index != p2->index )
return false;
}
}
return true;
}
@ -282,7 +282,7 @@ void CL_AllocRemapInfo( cl_entity_t *entity, int topcolor, int bottomcolor )
if( !phdr ) return; // bad model?
src = (mstudiotexture_t *)(((byte *)phdr) + phdr->textureindex);
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
dst = (clgame.remap_info[i] ? clgame.remap_info[i]->ptexture : NULL);
// NOTE: we must copy all the structures 'mstudiotexture_t' for easy access when model is rendering
if( !CL_CmpStudioTextures( phdr->numtextures, src, dst ) || clgame.remap_info[i]->model != entity->model )
@ -291,7 +291,7 @@ void CL_AllocRemapInfo( cl_entity_t *entity, int topcolor, int bottomcolor )
// e.g. playermodel 'barney' with playermodel 'gordon'
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
size = sizeof( remap_info_t ) + ( sizeof( mstudiotexture_t ) * phdr->numtextures );
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, size );
info->ptexture = (mstudiotexture_t *)(info + 1); // textures are immediately comes after remap_info
}
else
@ -328,7 +328,7 @@ void CL_AllocRemapInfo( cl_entity_t *entity, int topcolor, int bottomcolor )
// this code catches studiomodel change with another studiomodel with remap textures
// e.g. playermodel 'barney' with playermodel 'gordon'
if( clgame.remap_info[i] ) CL_FreeRemapInfo( clgame.remap_info[i] ); // free old info
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
info = clgame.remap_info[i] = Mem_Calloc( clgame.mempool, sizeof( remap_info_t ));
}
else
{
@ -409,7 +409,7 @@ void CL_FreeRemapInfo( remap_info_t *info )
ref.dllFuncs.GL_FreeTexture( info->textures[i] );
}
Mem_Free( info ); // release struct
Mem_Free( info ); // release struct
}
/*
@ -428,7 +428,7 @@ void CL_ClearAllRemaps( void )
for( i = 0; i < clgame.maxRemapInfos; i++ )
{
if( clgame.remap_info[i] )
CL_FreeRemapInfo( clgame.remap_info[i] );
CL_FreeRemapInfo( clgame.remap_info[i] );
}
Mem_Free( clgame.remap_info );
}

View File

@ -265,7 +265,7 @@ void CL_PrepareTEnt( TEMPENTITY *pTemp, model_t *pmodel )
// use these to set per-frame and termination conditions / actions
pTemp->entity.trivial_accept = modelHandle; // keep unchanged
pTemp->flags = FTENT_NONE;
pTemp->flags = FTENT_NONE;
pTemp->die = cl.time + 0.75f;
if( pmodel ) frameCount = pmodel->numframes;
@ -341,17 +341,17 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
}
zvel = abs( pTemp->entity.baseline.origin[2] );
// only play one out of every n
if( isshellcasing )
{
// play first bounce, then 1 out of 3
{
// play first bounce, then 1 out of 3
if( zvel < 200 && COM_RandomLong( 0, 3 ))
return;
}
else
{
if( COM_RandomLong( 0, 5 ))
if( COM_RandomLong( 0, 5 ))
return;
}
@ -359,11 +359,11 @@ void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
{
int pitch;
sound_t handle;
if( isshellcasing )
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
fvol *= min ( 1.0f, ((float)zvel) / 350.0f );
else fvol *= min ( 1.0f, ((float)zvel) / 450.0f );
if( !COM_RandomLong( 0, 3 ) && !isshellcasing )
pitch = COM_RandomLong( 95, 105 );
else pitch = PITCH_NORM;
@ -399,7 +399,7 @@ int CL_TempEntAddEntity( cl_entity_t *pEntity )
VectorCopy( pEntity->origin, pEntity->curstate.origin );
VectorCopy( pEntity->angles, pEntity->latched.prevangles );
VectorCopy( pEntity->origin, pEntity->latched.prevorigin );
// add to list
CL_AddVisibleEntity( pEntity, ET_TEMPENTITY );
@ -503,7 +503,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
if( !cl_free_tents )
{
// no temporary ents free, so find the first active low-priority temp ent
// no temporary ents free, so find the first active low-priority temp ent
// and overwrite it.
CL_FreeLowPriorityTempEnt();
}
@ -511,7 +511,7 @@ TEMPENTITY *CL_TempEntAllocHigh( const vec3_t org, model_t *pmodel )
if( !cl_free_tents )
{
// didn't find anything? The tent list is either full of high-priority tents
// or all tents in the list are still due to live for > 10 seconds.
// or all tents in the list are still due to live for > 10 seconds.
Con_DPrintf( "Couldn't alloc a high priority TENT!\n" );
return NULL;
}
@ -676,12 +676,12 @@ void GAME_EXPORT R_Bubbles( const vec3_t mins, const vec3_t maxs, float height,
pTemp->y = origin[1];
angle = COM_RandomFloat( -M_PI, M_PI );
SinCos( angle, &sine, &cosine );
zspeed = COM_RandomLong( 80, 140 );
VectorSet( pTemp->entity.baseline.origin, speed * cosine, speed * sine, zspeed );
pTemp->die = cl.time + ((height - (origin[2] - mins[2])) / zspeed) - 0.1f;
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
// Set sprite scale
pTemp->entity.curstate.scale = 1.0f / COM_RandomFloat( 2.0f, 5.0f );
pTemp->entity.curstate.rendermode = kRenderTransAlpha;
@ -767,7 +767,7 @@ void GAME_EXPORT R_AttachTentToPlayer( int client, int modelIndex, float zoffset
pTemp->entity.curstate.renderfx = kRenderFxNoDissipation;
pTemp->entity.curstate.framerate = 1;
pTemp->clientIndex = client;
pTemp->tentOffset[0] = 0;
pTemp->tentOffset[1] = 0;
@ -815,7 +815,7 @@ void GAME_EXPORT R_KillAttachedTents( int client )
// if it is attached to this client, set it to die instantly.
if( pTemp->clientIndex == client )
{
// good enough, it will die on next tent update.
// good enough, it will die on next tent update.
pTemp->die = cl.time;
}
}
@ -1026,7 +1026,7 @@ void GAME_EXPORT R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t
// limit to 100 pieces
if( count > 100 ) count = 100;
for( i = 0; i < count; i++ )
for( i = 0; i < count; i++ )
{
vec3_t vecSpot;
@ -1048,7 +1048,7 @@ void GAME_EXPORT R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t
// keep track of break_type, so we know how to play sound on collision
pTemp->hitSound = type;
if( pmodel->type == mod_sprite )
pTemp->entity.curstate.frame = COM_RandomLong( 0, pTemp->frameMax );
else if( pmodel->type == mod_studio )
@ -1056,7 +1056,7 @@ void GAME_EXPORT R_BreakModel( const vec3_t pos, const vec3_t size, const vec3_t
pTemp->flags |= FTENT_COLLIDEWORLD | FTENT_FADEOUT | FTENT_SLOWGRAVITY;
if( COM_RandomLong( 0, 255 ) < 200 )
if( COM_RandomLong( 0, 255 ) < 200 )
{
pTemp->flags |= FTENT_ROTATE;
pTemp->entity.baseline.angles[0] = COM_RandomFloat( -256, 255 );
@ -1177,7 +1177,7 @@ TEMPENTITY *R_DefaultSprite( const vec3_t pos, int spriteIndex, float framerate
===============
R_SparkShower
Create an animated moving sprite
Create an animated moving sprite
===============
*/
void GAME_EXPORT R_SparkShower( const vec3_t pos )
@ -1202,7 +1202,7 @@ void GAME_EXPORT R_SparkShower( const vec3_t pos )
===============
R_TempSprite
Create an animated moving sprite
Create an animated moving sprite
===============
*/
TEMPENTITY *R_TempSprite( vec3_t pos, const vec3_t dir, float scale, int modelIndex, int rendermode, int renderfx, float a, float life, int flags )
@ -1251,7 +1251,7 @@ void GAME_EXPORT R_Sprite_Explode( TEMPENTITY *pTemp, float scale, int flags )
{
// solid sprite
pTemp->entity.curstate.rendermode = kRenderNormal;
pTemp->entity.curstate.renderamt = 255;
pTemp->entity.curstate.renderamt = 255;
}
else if( FBitSet( flags, TE_EXPLFLAG_DRAWALPHA ))
{
@ -2405,7 +2405,7 @@ LIGHT STYLE MANAGEMENT
==============================================================
*/
#define STYLE_LERPING_THRESHOLD 3.0f // because we wan't interpolate fast sequences (like on\off)
/*
================
CL_ClearLightStyles
@ -2576,7 +2576,7 @@ void CL_DecayLights( void )
dlight_t *dl;
float time;
int i;
time = cl.time - cl.oldtime;
for( i = 0, dl = cl_dlights; i < MAX_DLIGHTS; i++, dl++ )
@ -2586,7 +2586,7 @@ void CL_DecayLights( void )
dl->radius -= time * dl->decay;
if( dl->radius < 0 ) dl->radius = 0;
if( dl->die < cl.time || !dl->radius )
if( dl->die < cl.time || !dl->radius )
memset( dl, 0, sizeof( *dl ));
}
@ -2597,7 +2597,7 @@ void CL_DecayLights( void )
dl->radius -= time * dl->decay;
if( dl->radius < 0 ) dl->radius = 0;
if( dl->die < cl.time || !dl->radius )
if( dl->die < cl.time || !dl->radius )
memset( dl, 0, sizeof( *dl ));
}
}
@ -2675,7 +2675,7 @@ void CL_UpdateFlashlight( cl_entity_t *ent )
else falloff = 500.0f / falloff;
falloff *= falloff;
// apply brigthness to dlight
// apply brigthness to dlight
dl->color.r = bound( 0, falloff * 255, 255 );
dl->color.g = bound( 0, falloff * 255, 255 );
dl->color.b = bound( 0, falloff * 255, 255 );
@ -2710,10 +2710,10 @@ void CL_AddEntityEffects( cl_entity_t *ent )
VectorCopy( ent->origin, dl->origin );
dl->die = cl.time + 0.001;
}
}
}
if( FBitSet( ent->curstate.effects, EF_BRIGHTLIGHT ))
{
{
dlight_t *dl = CL_AllocDlight( ent->index );
dl->color.r = dl->color.g = dl->color.b = 250;
if( ent->player ) dl->radius = 400; // don't flickering
@ -2979,7 +2979,7 @@ remove all decals with specified texture
*/
void GAME_EXPORT CL_DecalRemoveAll( int textureIndex )
{
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
int id = bound( 0, textureIndex, MAX_DECALS - 1 );
ref.dllFuncs.R_DecalRemoveAll( cl.decal_index[id] );
}
@ -3032,7 +3032,7 @@ void CL_ClearStaticEntities( void )
CL_ClearEfrags ();
}
/*
==============
CL_ClearEffects

View File

@ -87,7 +87,7 @@ void SCR_CheckStartupVids( void )
byte *afile;
char *pfile;
string token;
if( Sys_CheckParm( "-nointro" ) || host_developer.value || cls.demonum != -1 || GameState->nextstate != STATE_RUNFRAME )
{
// don't run movies where we in developer-mode
@ -122,7 +122,7 @@ void SCR_CheckStartupVids( void )
SCR_NextMovie ();
Cbuf_Execute();
}
/*
==================
SCR_RunCinematic
@ -152,7 +152,7 @@ void SCR_RunCinematic( void )
return;
}
// advances cinematic time (ignores maxfps and host_framerate settings)
// advances cinematic time (ignores maxfps and host_framerate settings)
cin_time += host.realframetime;
// stop the video after it finishes
@ -194,7 +194,7 @@ qboolean SCR_DrawCinematic( void )
return true;
}
/*
==================
SCR_PlayCinematic
@ -238,7 +238,7 @@ qboolean SCR_PlayCinematic( const char *arg )
Con_FastClose();
cin_time = 0.0f;
cls.signon = 0;
return true;
}
@ -258,7 +258,7 @@ wavdata_t *SCR_GetMovieInfo( void )
return &cin_audio;
return NULL;
}
/*
==================
SCR_StopCinematic

View File

@ -35,7 +35,7 @@ void V_CalcViewRect( void )
int sb_lines;
float size;
// intermission is always full screen
// intermission is always full screen
if( cl.intermission ) size = 120.0f;
else size = scr_viewsize->value;

View File

@ -110,7 +110,7 @@ extern int CL_UPDATE_BACKUP;
#define MIN_EX_INTERP 50.0f
#define MAX_EX_INTERP 100.0f
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
#define CL_MIN_RESEND_TIME 1.5f // mininum time gap (in seconds) before a subsequent connection request is sent.
#define CL_MAX_RESEND_TIME 20.0f // max time. The cvar cl_resend is bounded by these.
#define cl_serverframetime() (cl.mtime[0] - cl.mtime[1])
@ -180,7 +180,7 @@ typedef struct
// render a frame yet
int parsecount; // server message counter
int parsecountmod; // modulo with network window
qboolean video_prepped; // false if on new level or new ref dll
qboolean audio_prepped; // false if on new level or new snd dll
qboolean paused;
@ -306,7 +306,7 @@ typedef struct
char name[32];
int number; // svc_ number
int size; // if size == -1, size come from first byte after svcnum
pfnUserMsgHook func; // user-defined function
pfnUserMsgHook func; // user-defined function
} cl_user_message_t;
typedef void (*pfnEventHook)( event_args_t *args );
@ -538,7 +538,7 @@ typedef struct
netadr_t hltv_listen_address;
int signon; // 0 to SIGNONS, for the signon sequence.
int signon; // 0 to SIGNONS, for the signon sequence.
int quakePort; // a 16 bit value that allows quake servers
// to work around address translating routers
// g-cont. this port allow many copies of engine in multiplayer game
@ -848,7 +848,7 @@ _inline cl_entity_t *CL_EDICT_NUM( int n )
return clgame.entities + n;
Host_Error( "CL_EDICT_NUM: bad number %i\n", n );
return NULL;
return NULL;
}
//

View File

@ -24,17 +24,6 @@ GNU General Public License for more details.
#define SHRT_MAX 0x7FFF
#endif
typedef enum engineAxis_e
{
JOY_AXIS_SIDE = 0,
JOY_AXIS_FWD,
JOY_AXIS_PITCH,
JOY_AXIS_YAW,
JOY_AXIS_RT,
JOY_AXIS_LT,
JOY_AXIS_NULL
} engineAxis_t;
#define MAX_AXES JOY_AXIS_NULL
// index - axis num come from event
@ -246,8 +235,6 @@ Axis events
*/
void Joy_AxisMotionEvent( byte axis, short value )
{
byte engineAxis;
if( !joy_found->value )
return;
@ -257,8 +244,11 @@ void Joy_AxisMotionEvent( byte axis, short value )
return;
}
engineAxis = joyaxesmap[axis]; // convert to engine inner axis control
return Joy_KnownAxisMotionEvent( joyaxesmap[axis], value );
}
void Joy_KnownAxisMotionEvent( engineAxis_t engineAxis, short value )
{
if( engineAxis == JOY_AXIS_NULL )
return;
@ -395,8 +385,8 @@ void Joy_Init( void )
joy_side = Cvar_Get( "joy_side", "1.0", FCVAR_ARCHIVE, "joystick side sensitivity. Values from -1.0 to 1.0" );
joy_forward = Cvar_Get( "joy_forward", "1.0", FCVAR_ARCHIVE, "joystick forward sensitivity. Values from -1.0 to 1.0" );
joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "-16384", FCVAR_ARCHIVE, "left trigger threshold. Value from -32768 to 32767");
joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "-16384", FCVAR_ARCHIVE, "right trigger threshold. Value from -32768 to 32767" );
joy_lt_threshold = Cvar_Get( "joy_lt_threshold", "16384", FCVAR_ARCHIVE, "left trigger threshold. Value from 0 to 32767");
joy_rt_threshold = Cvar_Get( "joy_rt_threshold", "16384", FCVAR_ARCHIVE, "right trigger threshold. Value from 0 to 32767" );
// emit a key event at 75% axis move
joy_side_key_threshold = Cvar_Get( "joy_side_key_threshold", "24576", FCVAR_ARCHIVE, "side axis key event emit threshold. Value from 0 to 32767" );

View File

@ -252,7 +252,7 @@ void Touch_WriteConfig( void )
Q_strncpy( newCommand, B(command), MAX_STRING );
FS_Printf( f, "touch_addbutton \"%s\" \"%s\" \"%s\" %f %f %f %f %d %d %d %d %d\n",
FS_Printf( f, "touch_addbutton \"%s\" \"%s\" \"%s\" %f %f %f %f %d %d %d %d %d\n",
B(name), B(texturefile), newCommand,
B(x1), B(y1), B(x2), B(y2),
B(color[0]), B(color[1]), B(color[2]), B(color[3]), flags );
@ -351,7 +351,7 @@ void Touch_ExportConfig_f( void )
//Com_EscapeCommand( newCommand, B(command), MAX_STRING );
Q_strncpy( newCommand, B(command), MAX_STRING );
FS_Printf( f, "touch_addbutton \"%s\" \"%s\" \"%s\" %f %f %f %f %d %d %d %d %d %f\n",
FS_Printf( f, "touch_addbutton \"%s\" \"%s\" \"%s\" %f %f %f %f %d %d %d %d %d %f\n",
B(name), B(texturefile), newCommand,
B(x1), B(y1), B(x2), B(y2),
B(color[0]), B(color[1]), B(color[2]), B(color[3]), flags, aspect );
@ -578,7 +578,7 @@ void Touch_HideButtons( const char *name, byte hide )
button->flags &= ~TOUCH_FL_HIDE;
}
}
}
void Touch_ToggleSelection_f( void )
@ -737,13 +737,13 @@ void Touch_LoadDefaults_f( void )
for( i = 0; i < g_LastDefaultButton; i++ )
{
touch_button_t *button;
float x1 = g_DefaultButtons[i].x1,
float x1 = g_DefaultButtons[i].x1,
y1 = g_DefaultButtons[i].y1,
x2 = g_DefaultButtons[i].x2,
y2 = g_DefaultButtons[i].y2;
y2 = g_DefaultButtons[i].y2;
IN_TouchCheckCoords( &x1, &y1, &x2, &y2 );
if( g_DefaultButtons[i].aspect && g_DefaultButtons[i].round == round_aspect )
{
if( g_DefaultButtons[i].texturefile[0] == '#' )
@ -751,7 +751,7 @@ void Touch_LoadDefaults_f( void )
else
y2 = y1 + ( x2 - x1 ) * (SCR_W/SCR_H) * g_DefaultButtons[i].aspect;
}
IN_TouchCheckCoords( &x1, &y1, &x2, &y2 );
button = Touch_AddButton( &touch.list_user, g_DefaultButtons[i].name, g_DefaultButtons[i].texturefile, g_DefaultButtons[i].command, x1, y1, x2, y2, g_DefaultButtons[i].color );
button->flags |= g_DefaultButtons[i].flags;
@ -792,10 +792,10 @@ void Touch_AddButton_f( void )
if( argc >= 12 )
{
touch_button_t *button;
MakeRGBA( color, Q_atoi( Cmd_Argv(8) ), Q_atoi( Cmd_Argv(9) ),
MakeRGBA( color, Q_atoi( Cmd_Argv(8) ), Q_atoi( Cmd_Argv(9) ),
Q_atoi( Cmd_Argv(10) ), Q_atoi( Cmd_Argv(11) ) );
button = Touch_AddButton( &touch.list_user, Cmd_Argv(1), Cmd_Argv(2), Cmd_Argv(3),
Q_atof( Cmd_Argv(4) ), Q_atof( Cmd_Argv(5) ),
Q_atof( Cmd_Argv(4) ), Q_atof( Cmd_Argv(5) ),
Q_atof( Cmd_Argv(6) ), Q_atof( Cmd_Argv(7) ) ,
color );
if( argc >= 13 )
@ -812,14 +812,14 @@ void Touch_AddButton_f( void )
B(aspect) = aspect;
}
}
return;
}
}
if( argc == 8 )
{
MakeRGBA( color, 255, 255, 255, 255 );
Touch_AddButton( &touch.list_user, Cmd_Argv(1), Cmd_Argv(2), Cmd_Argv(3),
Q_atof( Cmd_Argv(4) ), Q_atof( Cmd_Argv(5) ),
Q_atof( Cmd_Argv(4) ), Q_atof( Cmd_Argv(5) ),
Q_atof( Cmd_Argv(6) ), Q_atof( Cmd_Argv(7) ),
color );
return;
@ -931,7 +931,7 @@ void Touch_Init( void )
Touch_AddDefaultButton( "edit", "touch_default/settings.tga", "touch_enableedit", 0.420000, 0.000000, 0.500000, 0.151486, color, 2, 1, 32 );
Touch_AddDefaultButton( "menu", "touch_default/menu.tga", "escape", 0.000000, 0.833171, 0.080000, 0.984656, color, 2, 1, 0 );
Cmd_AddCommand( "touch_addbutton", Touch_AddButton_f, "add native touch button" );
Cmd_AddCommand( "touch_removebutton", IN_TouchRemoveButton_f, "remove native touch button" );
Cmd_AddCommand( "touch_enableedit", Touch_EnableEdit_f, "enable button editing mode" );
@ -1035,12 +1035,12 @@ qboolean Touch_IsVisible( touch_button_t *button )
return true;
/*
return ( !touch.clientonly || ( button->flags & TOUCH_FL_CLIENT) ) &&
(
return ( !touch.clientonly || ( button->flags & TOUCH_FL_CLIENT) ) &&
(
( touch.state >= state_edit )
||( !( button->flags & TOUCH_FL_HIDE )
&& ( !(button->flags & TOUCH_FL_SP) || ( CL_GetMaxClients() == 1 ) )
&& ( !(button->flags & TOUCH_FL_MP) || ( CL_GetMaxClients() != 1 ) ) )
||( !( button->flags & TOUCH_FL_HIDE )
&& ( !(button->flags & TOUCH_FL_SP) || ( CL_GetMaxClients() == 1 ) )
&& ( !(button->flags & TOUCH_FL_MP) || ( CL_GetMaxClients() != 1 ) ) )
);
*/
}
@ -1128,7 +1128,7 @@ float Touch_DrawText( float x1, float y1, float x2, float y2, const char *s, byt
maxx = x2 - cls.creditsFont.charWidths['M'] / 1024.0f * size;
else
maxx = 1;
if( !cls.creditsFont.valid )
return GRID_X * 2;
Con_UtfProcessChar( 0 );
@ -1159,7 +1159,7 @@ float Touch_DrawText( float x1, float y1, float x2, float y2, const char *s, byt
void Touch_DrawButtons( touchbuttonlist_t *list )
{
touch_button_t *button;
for( button = list->first; button; button = button->next )
{
if( Touch_IsVisible( button ) )
@ -1240,7 +1240,7 @@ void Touch_DrawButtons( touchbuttonlist_t *list )
Con_DrawString( TO_SCRN_X( B(x1) ), TO_SCRN_Y( B(y1) ), B(name), color );
}
}
}
void Touch_Draw( void )
@ -1403,7 +1403,7 @@ static void Touch_EditMove( touchEventType type, int fingerID, float x, float y,
touch.edit->x2 += dx;
}
}
else
else
{
if( type == event_down ) // enable resizing
{
@ -1489,7 +1489,7 @@ static void Touch_Motion( touchEventType type, int fingerID, float x, float y, f
{
if( touch.precision )
dx *= touch_precise_amount->value, dy *= touch_precise_amount->value;
if( CVAR_TO_BOOL(touch_nonlinear_look) )
{
float dabs, dcos, dsin;
@ -1502,7 +1502,7 @@ static void Touch_Motion( touchEventType type, int fingerID, float x, float y, f
dcos = dx / dabs;
dsin = dy / dabs;
if( touch_exp_mult->value > 1 )
dabs = ( exp( dabs * touch_exp_mult->value ) - 1 ) / touch_exp_mult->value;
@ -1772,7 +1772,7 @@ static qboolean Touch_ButtonEdit( touchEventType type, int fingerID, float x, fl
y > button->y1 ) )
{
button->finger = fingerID;
// do not edit NOEDIT buttons
if( button->flags & TOUCH_FL_NOEDIT )
continue;
@ -1785,7 +1785,7 @@ static qboolean Touch_ButtonEdit( touchEventType type, int fingerID, float x, fl
{
if( button->prev )
button->prev->next = button->next;
else
else
touch.list_user.first = button->next;
button->next->prev = button->prev;
@ -1946,7 +1946,7 @@ void Touch_KeyEvent( int key, int down )
void Touch_Shutdown( void )
{
if( !touch.initialized )
if( !touch.initialized )
return;
Touch_RemoveAll_f();
Cmd_RemoveCommand( "touch_addbutton" );

View File

@ -260,12 +260,12 @@ void IN_ActivateMouse( qboolean force )
{
int width, height;
static int oldstate;
if( !in_mouseinitialized )
return;
if( CL_Active() && host.mouse_visible && !force )
return; // VGUI controls
return; // VGUI controls
if( cls.key_dest == key_menu && !Cvar_VariableInteger( "fullscreen" ))
{
@ -341,7 +341,7 @@ IN_MouseMove
void IN_MouseMove( void )
{
POINT current_pos;
if( !in_mouseinitialized || !in_mouseactive || !UI_IsVisible( ))
return;
@ -588,10 +588,10 @@ void IN_CollectInput( float *forward, float *side, float *pitch, float *yaw, qbo
IN_EvdevMove( yaw, pitch );
#endif
}
Joy_FinalizeMove( forward, side, yaw, pitch );
Touch_GetMove( forward, side, yaw, pitch );
if( look_filter->value )
{
*pitch = ( inputstate.lastpitch + *pitch ) / 2;
@ -627,7 +627,7 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
float sensitivity = 1;//( (float)cl.local.scr_fov / (float)90.0f );
IN_CollectInput( &forward, &side, &pitch, &yaw, in_mouseinitialized && !CVAR_TO_BOOL( m_ignore ), m_enginemouse->value );
IN_JoyAppendMove( cmd, forward, side );
if( pitch || yaw )
@ -683,7 +683,7 @@ void Host_InputFrame( void )
// release mouse during pause or console typeing
if( cl.paused && cls.key_dest == key_game )
shutdownMouse = true;
if( shutdownMouse && !Cvar_VariableInteger( "fullscreen" ))
{
IN_DeactivateMouse();

View File

@ -93,9 +93,21 @@ enum
JOY_HAT_LEFTDOWN = JOY_HAT_LEFT | JOY_HAT_DOWN
};
typedef enum engineAxis_e
{
JOY_AXIS_SIDE = 0,
JOY_AXIS_FWD,
JOY_AXIS_PITCH,
JOY_AXIS_YAW,
JOY_AXIS_RT,
JOY_AXIS_LT,
JOY_AXIS_NULL
} engineAxis_t;
qboolean Joy_IsActive( void );
void Joy_HatMotionEvent( byte hat, byte value );
void Joy_AxisMotionEvent( byte axis, short value );
void Joy_KnownAxisMotionEvent( engineAxis_t engineAxis, short value );
void Joy_BallMotionEvent( byte ball, short xrel, short yrel );
void Joy_ButtonEvent( byte button, byte down );
void Joy_AddEvent( void );

View File

@ -98,26 +98,32 @@ keyname_t keynames[] =
{"KP_PLUS", K_KP_PLUS, "" },
{"PAUSE", K_PAUSE, "pause" },
{"A_BUTTON", K_A_BUTTON, ""}, // they match xbox controller
{"B_BUTTON", K_B_BUTTON, ""},
{"X_BUTTON", K_X_BUTTON, ""},
{"Y_BUTTON", K_Y_BUTTON, ""},
{"L1_BUTTON", K_L1_BUTTON, ""},
{"R1_BUTTON", K_R1_BUTTON, ""},
{"BACK", K_BACK_BUTTON, ""},
// Gamepad
// A/B X/Y names match the Xbox controller layout
{"A_BUTTON", K_A_BUTTON, "+jump"},
{"B_BUTTON", K_B_BUTTON, "+use"},
{"X_BUTTON", K_X_BUTTON, "+reload"}, // Flashlight
{"Y_BUTTON", K_Y_BUTTON, "impulse 100"},
{"BACK", K_BACK_BUTTON, "cancelselect"}, // Menu
{"MODE", K_MODE_BUTTON, ""},
{"START", K_START_BUTTON, ""},
{"STICK1", K_LSTICK, ""},
{"STICK2", K_RSTICK, ""},
{"L2_BUTTON", K_L2_BUTTON, ""}, // in case...
{"R2_BUTTON", K_R2_BUTTON, ""},
{"START", K_START_BUTTON, "pause"},
{"STICK1", K_LSTICK, "+speed"},
{"STICK2", K_RSTICK, "+duck"},
{"L1_BUTTON", K_L1_BUTTON, "+duck"},
{"R1_BUTTON", K_R1_BUTTON, "+attack"},
{"DPAD_UP", K_DPAD_UP, "impulse 201"}, // Spray
{"DPAD_DOWN", K_DPAD_DOWN, "lastinv"},
{"DPAD_LEFT", K_DPAD_LEFT, "invprev"},
{"DPAD_RIGHT", K_DPAD_RIGHT, "invnext"},
{"L2_BUTTON", K_L2_BUTTON, "+speed"},
{"R2_BUTTON", K_R2_BUTTON, "+attack2"},
{"LTRIGGER" , K_JOY1 , "+speed"}, // L2 in SDL2
{"RTRIGGER" , K_JOY2 , "+attack2"}, // R2 in SDL2
{"JOY3" , K_JOY3 , ""},
{"JOY4" , K_JOY4 , ""},
{"C_BUTTON", K_C_BUTTON, ""},
{"Z_BUTTON", K_Z_BUTTON, ""},
{"AUX16", K_AUX16, ""}, // generic
{"AUX17", K_AUX17, ""},
{"AUX18", K_AUX18, ""},
{"AUX19", K_AUX19, ""},
{"AUX20", K_AUX20, ""},
{"AUX20", K_AUX20, ""}, // generic
{"AUX21", K_AUX21, ""},
{"AUX22", K_AUX22, ""},
{"AUX23", K_AUX23, ""},
@ -130,10 +136,6 @@ keyname_t keynames[] =
{"AUX30", K_AUX30, ""},
{"AUX31", K_AUX31, ""},
{"AUX32", K_AUX32, ""},
{"LTRIGGER" , K_JOY1 , ""},
{"RTRIGGER" , K_JOY2 , ""},
{"JOY3" , K_JOY3 , ""},
{"JOY4" , K_JOY4 , ""},
// raw semicolon seperates commands
{"SEMICOLON", ';', "" },
@ -185,7 +187,7 @@ to be configured even if they don't have defined names.
int Key_StringToKeynum( const char *str )
{
keyname_t *kn;
if( !str || !str[0] ) return -1;
if( !str[1] ) return str[0];
@ -193,7 +195,7 @@ int Key_StringToKeynum( const char *str )
if( str[0] == '0' && str[1] == 'x' && Q_strlen( str ) == 4 )
{
int n1, n2;
n1 = str[2];
if( n1 >= '0' && n1 <= '9' )
{
@ -239,7 +241,7 @@ given keynum.
*/
const char *Key_KeynumToString( int keynum )
{
keyname_t *kn;
keyname_t *kn;
static char tinystr[5];
int i, j;
@ -289,7 +291,7 @@ void GAME_EXPORT Key_SetBinding( int keynum, const char *binding )
Mem_Free((char *)keys[keynum].binding );
keys[keynum].binding = NULL;
}
// allocate memory for new binding
keys[keynum].binding = copystring( binding );
}
@ -306,7 +308,7 @@ const char *Key_GetBinding( int keynum )
return keys[keynum].binding;
}
/*
/*
===================
Key_GetKey
===================
@ -351,7 +353,7 @@ void Key_Unbind_f( void )
Con_Printf( S_USAGE "unbind <key> : remove commands from a key\n" );
return;
}
b = Key_StringToKeynum( Cmd_Argv( 1 ));
if( b == -1 )
@ -371,7 +373,7 @@ Key_Unbindall_f
void Key_Unbindall_f( void )
{
int i;
for( i = 0; i < 256; i++ )
{
if( keys[i].binding )
@ -392,7 +394,7 @@ void Key_Reset_f( void )
keyname_t *kn;
int i;
// clear all keys first
// clear all keys first
for( i = 0; i < 256; i++ )
{
if( keys[i].binding )
@ -401,7 +403,7 @@ void Key_Reset_f( void )
// apply default values
for( kn = keynames; kn->name; kn++ )
Key_SetBinding( kn->keynum, kn->binding );
Key_SetBinding( kn->keynum, kn->binding );
}
/*
@ -413,7 +415,7 @@ void Key_Bind_f( void )
{
char cmd[1024];
int i, c, b;
c = Cmd_Argc();
if( c < 2 )
@ -437,7 +439,7 @@ void Key_Bind_f( void )
else Con_Printf( "\"%s\" is not bound\n", Cmd_Argv( 1 ));
return;
}
// copy the rest of the command line
cmd[0] = 0; // start out with a null string
@ -515,10 +517,10 @@ void Key_Init( void )
Cmd_AddCommand( "unbindall", Key_Unbindall_f, "removes all commands from all keys in bindmap" );
Cmd_AddCommand( "resetkeys", Key_Reset_f, "reset all keys to their default values" );
Cmd_AddCommand( "bindlist", Key_Bindlist_f, "display current key bindings" );
Cmd_AddCommand( "makehelp", Key_EnumCmds_f, "write help.txt that contains all console cvars and cmds" );
Cmd_AddCommand( "makehelp", Key_EnumCmds_f, "write help.txt that contains all console cvars and cmds" );
// setup default binding. "unbindall" from config.cfg will be reset it
for( kn = keynames; kn->name; kn++ ) Key_SetBinding( kn->keynum, kn->binding );
for( kn = keynames; kn->name; kn++ ) Key_SetBinding( kn->keynum, kn->binding );
osk_enable = Cvar_Get( "osk_enable", "0", FCVAR_ARCHIVE, "enable built-in on-screen keyboard" );
key_rotate = Cvar_Get( "key_rotate", "0", FCVAR_ARCHIVE, "rotate arrow keys (0-3)" );
@ -592,7 +594,7 @@ static qboolean Key_IsAllowedAutoRepeat( int key )
return true;
default:
return false;
}
}
}
static int Key_Rotate( int key )
@ -774,7 +776,7 @@ void GAME_EXPORT Key_Event( int key, int down )
// key up events only perform actions if the game key binding is
// a button command (leading + sign). These will be processed even in
// console mode and menu mode, to keep the character from continuing
// console mode and menu mode, to keep the character from continuing
// an action started before a mode switch.
if( !down )
{
@ -892,7 +894,7 @@ void CL_CharEvent( int key )
if( cls.key_dest == key_console && !Con_Visible( ))
{
if((char)key == '`' || (char)key == '?' )
return; // don't pass '`' when we open the console
return; // don't pass '`' when we open the console
}
// distribute the key down event to the apropriate handler

View File

@ -590,10 +590,9 @@ static void SetFullscreenModeFromCommandLine( void )
void R_CollectRendererNames( void )
{
const char *renderers[] = DEFAULT_RENDERERS;
int i;
ref.numRenderers = 0;
int i, cur;
cur = 0;
for( i = 0; i < DEFAULT_RENDERERS_LEN; i++ )
{
string temp;
@ -616,32 +615,33 @@ void R_CollectRendererNames( void )
continue;
}
Q_strncpy( ref.shortNames[i], renderers[i], sizeof( ref.shortNames[i] ));
Q_strncpy( ref.shortNames[cur], renderers[i], sizeof( ref.shortNames[cur] ));
pfn = COM_GetProcAddress( dll, GET_REF_HUMANREADABLE_NAME );
if( !pfn ) // just in case
{
Con_Reportf( "R_CollectRendererNames: can't find GetHumanReadableName export in %s\n", temp );
Q_strncpy( ref.readableNames[i], renderers[i], sizeof( ref.readableNames[i] ));
Q_strncpy( ref.readableNames[cur], renderers[i], sizeof( ref.readableNames[cur] ));
}
else
{
REF_HUMANREADABLE_NAME GetHumanReadableName = (REF_HUMANREADABLE_NAME)pfn;
GetHumanReadableName( ref.readableNames[i], sizeof( ref.readableNames[i] ));
GetHumanReadableName( ref.readableNames[cur], sizeof( ref.readableNames[cur] ));
}
Con_Printf( "Found renderer %s: %s\n", ref.shortNames[i], ref.readableNames[i] );
Con_Printf( "Found renderer %s: %s\n", ref.shortNames[cur], ref.readableNames[cur] );
ref.numRenderers++;
cur++;
COM_FreeLibrary( dll );
}
ref.numRenderers = cur;
}
qboolean R_Init( void )
{
qboolean success = false;
string refopt;
string requested;
gl_vsync = Cvar_Get( "gl_vsync", "0", FCVAR_ARCHIVE, "enable vertical syncronization" );
gl_showtextures = Cvar_Get( "r_showtextures", "0", FCVAR_CHEAT, "show all uploaded textures" );
@ -663,15 +663,19 @@ qboolean R_Init( void )
R_CollectRendererNames();
// command line have priority
if( !Sys_GetParmFromCmdLine( "-ref", refopt ) )
{
// Priority:
// 1. Command line `-ref` argument.
// 2. `ref_dll` cvar.
// 3. Detected renderers in `DEFAULT_RENDERERS` order.
requested[0] = '\0';
if( !Sys_GetParmFromCmdLine( "-ref", requested ) && COM_CheckString( r_refdll->string ) )
// r_refdll is set to empty by default, so we can change hardcoded defaults just in case
Q_strncpy( refopt, COM_CheckString( r_refdll->string ) ?
r_refdll->string : DEFAULT_ACCELERATED_RENDERER, sizeof( refopt ) );
}
Q_strncpy( requested, r_refdll->string, sizeof( requested ) );
if( !(success = R_LoadRenderer( refopt )))
if ( requested[0] )
success = R_LoadRenderer( requested );
if( !success )
{
int i;
@ -679,7 +683,7 @@ qboolean R_Init( void )
for( i = 0; i < ref.numRenderers; i++ )
{
// skip renderer that was requested but failed to load
if( Q_strcmp( refopt, ref.shortNames[i] ))
if( !Q_strcmp( requested, ref.shortNames[i] ) )
continue;
success = R_LoadRenderer( ref.shortNames[i] );

View File

@ -211,7 +211,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
return NULL;
s_numSfx++;
}
sfx = &s_knownSfx[i];
memset( sfx, 0, sizeof( *sfx ));
if( pfInCache ) *pfInCache = false;
@ -222,7 +222,7 @@ sfx_t *S_FindName( const char *pname, int *pfInCache )
// link it in
sfx->hashNext = s_sfxHashList[sfx->hashValue];
s_sfxHashList[sfx->hashValue] = sfx;
return sfx;
}
@ -299,7 +299,7 @@ void S_EndRegistration( void )
if( !s_registering || !dma.initialized )
return;
// free any sounds not from this registration sequence
for( i = 0, sfx = s_knownSfx; i < s_numSfx; i++, sfx++ )
{

View File

@ -80,8 +80,8 @@ void S_FadeClientVolume( float fadePercent, float fadeOutSeconds, float holdTime
{
soundfade.starttime = cl.mtime[0];
soundfade.initial_percent = fadePercent;
soundfade.fadeouttime = fadeOutSeconds;
soundfade.holdtime = holdTime;
soundfade.fadeouttime = fadeOutSeconds;
soundfade.holdtime = holdTime;
soundfade.fadeintime = fadeInSeconds;
}
@ -97,7 +97,7 @@ qboolean S_IsClient( int entnum )
// free channel so that it may be allocated by the
// next request to play a sound. If sound is a
// next request to play a sound. If sound is a
// word in a sentence, release the sentence.
// Works for static, dynamic, sentence and stream sounds
/*
@ -129,7 +129,7 @@ void S_UpdateSoundFade( void )
// determine current fade value.
// assume no fading remains
soundfade.percent = 0;
soundfade.percent = 0;
totaltime = soundfade.fadeouttime + soundfade.fadeintime + soundfade.holdtime;
@ -178,7 +178,7 @@ void S_UpdateSoundFade( void )
=================
SND_FStreamIsPlaying
Select a channel from the dynamic channel allocation area. For the given entity,
Select a channel from the dynamic channel allocation area. For the given entity,
override any other sound playing on the same channel (see code comments below for
exceptions).
=================
@ -200,7 +200,7 @@ qboolean SND_FStreamIsPlaying( sfx_t *sfx )
=================
SND_PickDynamicChannel
Select a channel from the dynamic channel allocation area. For the given entity,
Select a channel from the dynamic channel allocation area. For the given entity,
override any other sound playing on the same channel (see code comments below for
exceptions).
=================
@ -227,7 +227,7 @@ channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx, qboolean
for( ch_idx = NUM_AMBIENTS; ch_idx < MAX_DYNAMIC_CHANNELS; ch_idx++ )
{
channel_t *ch = &channels[ch_idx];
// Never override a streaming sound that is currently playing or
// voice over IP data that is playing or any sound on CHAN_VOICE( acting )
if( ch->sfx && ( ch->entchannel == CHAN_STREAM ))
@ -290,8 +290,8 @@ channel_t *SND_PickDynamicChannel( int entnum, int channel, sfx_t *sfx, qboolean
SND_PickStaticChannel
Pick an empty channel from the static sound area, or allocate a new
channel. Only fails if we're at max_channels (128!!!) or if
we're trying to allocate a channel for a stream sound that is
channel. Only fails if we're at max_channels (128!!!) or if
we're trying to allocate a channel for a stream sound that is
already playing.
=====================
*/
@ -310,7 +310,7 @@ channel_t *SND_PickStaticChannel( const vec3_t pos, sfx_t *sfx )
break;
}
if( i < total_channels )
if( i < total_channels )
{
// reuse an empty static sound channel
ch = &channels[i];
@ -346,7 +346,7 @@ returns FALSE if sound was not found (sound is not playing)
int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int flags )
{
channel_t *ch;
int i;
int i;
if( S_TestSoundChar( sfx->name, '!' ))
{
@ -361,10 +361,10 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int
{
if( flags & SND_CHANGE_PITCH )
ch->basePitch = pitch;
if( flags & SND_CHANGE_VOL )
ch->master_vol = vol;
if( flags & SND_STOP )
S_FreeChannel( ch );
@ -383,7 +383,7 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int
{
if( flags & SND_CHANGE_PITCH )
ch->basePitch = pitch;
if( flags & SND_CHANGE_VOL )
ch->master_vol = vol;
@ -476,7 +476,7 @@ void SND_Spatialize( channel_t *ch )
====================
S_StartSound
Start a sound effect for the given entity on the given channel (ie; voice, weapon etc).
Start a sound effect for the given entity on the given channel (ie; voice, weapon etc).
Try to grab a channel out of the 8 dynamic spots available.
Currently used for looping sounds, streaming sounds, sentences, and regular entity sounds.
NOTE: volume is 0.0 - 1.0 and attenuation is 0.0 - 1.0 when passed in.
@ -509,7 +509,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
return;
if( flags & SND_STOP ) return;
// fall through - if we're not trying to stop the sound,
// fall through - if we're not trying to stop the sound,
// and we didn't find it (it's not playing), go ahead and start it up
}
@ -552,7 +552,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
// link all words and load the first word
// NOTE: sentence names stored in the cache lookup are
// prepended with a '!'. Sentence names stored in the
// sentence file do not have a leading '!'.
// sentence file do not have a leading '!'.
VOX_LoadSound( target_chan, S_SkipSoundChar( sfx->name ));
Q_strncpy( target_chan->name, sfx->name, sizeof( target_chan->name ));
sfx = target_chan->sfx;
@ -574,7 +574,7 @@ void S_StartSound( const vec3_t pos, int ent, int chan, sound_t handle, float fv
SND_Spatialize( target_chan );
// If a client can't hear a sound when they FIRST receive the StartSound message,
// the client will never be able to hear that sound. This is so that out of
// the client will never be able to hear that sound. This is so that out of
// range sounds don't fill the playback buffer. For streaming sounds, we bypass this optimization.
if( !target_chan->leftvol && !target_chan->rightvol )
{
@ -664,7 +664,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
// link all words and load the first word
// NOTE: sentence names stored in the cache lookup are
// prepended with a '!'. Sentence names stored in the
// sentence file do not have a leading '!'.
// sentence file do not have a leading '!'.
VOX_LoadSound( target_chan, S_SkipSoundChar( sfx->name ));
Q_strncpy( target_chan->name, sfx->name, sizeof( target_chan->name ));
@ -708,7 +708,7 @@ void S_RestoreSound( const vec3_t pos, int ent, int chan, sound_t handle, float
// apply the sample offests
target_chan->pMixer.sample = sample;
target_chan->pMixer.forcedEndSample = end;
target_chan->pMixer.forcedEndSample = end;
// Init client entity mouth movement vars
SND_InitMouth( ent, chan );
@ -763,7 +763,7 @@ void S_AmbientSound( const vec3_t pos, int ent, sound_t handle, float fvol, floa
// this is a sentence. link words to play in sequence.
// NOTE: sentence names stored in the cache lookup are
// prepended with a '!'. Sentence names stored in the
// sentence file do not have a leading '!'.
// sentence file do not have a leading '!'.
// link all words and load the first word
VOX_LoadSound( ch, S_SkipSoundChar( sfx->name ));
@ -812,7 +812,7 @@ void S_StartLocalSound( const char *name, float volume, qboolean reliable )
if( reliable ) channel = CHAN_STATIC;
if( !dma.initialized ) return;
if( !dma.initialized ) return;
sfxHandle = S_RegisterSound( name );
S_StartSound( NULL, s_listener.entnum, channel, sfxHandle, volume, ATTN_NONE, PITCH_NORM, flags );
}
@ -881,7 +881,7 @@ int S_GetCurrentDynamicSounds( soundlist_t *pout, int size )
looped = ( channels[i].use_loop && channels[i].sfx->cache->loopStart != -1 );
if( channels[i].entchannel == CHAN_STATIC && looped && !Host_IsQuakeCompatible())
continue; // never serialize static looped sounds. It will be restoring in game code
continue; // never serialize static looped sounds. It will be restoring in game code
if( channels[i].isSentence && channels[i].name[0] )
Q_strncpy( pout->name, channels[i].name, sizeof( pout->name ));
@ -916,7 +916,7 @@ void S_InitAmbientChannels( void )
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
{
chan = &channels[ambient_channel];
chan = &channels[ambient_channel];
chan->staticsound = true;
chan->use_loop = true;
@ -954,7 +954,7 @@ void S_UpdateAmbientSounds( void )
for( ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++ )
{
chan = &channels[ambient_channel];
chan = &channels[ambient_channel];
chan->sfx = S_GetSfxByHandle( ambient_sfx[ambient_channel] );
// ambient is unused
@ -979,7 +979,7 @@ void S_UpdateAmbientSounds( void )
chan->master_vol -= s_listener.frametime * s_ambient_fade->value;
if( chan->master_vol < vol ) chan->master_vol = vol;
}
chan->leftvol = chan->rightvol = chan->master_vol;
}
}
@ -1240,7 +1240,7 @@ void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float sy
S_GetRawSamplesLength
===================
*/
uint S_GetRawSamplesLength( int entnum )
uint S_GetRawSamplesLength( int entnum )
{
rawchan_t *ch;
@ -1255,7 +1255,7 @@ uint S_GetRawSamplesLength( int entnum )
S_ClearRawChannel
===================
*/
void S_ClearRawChannel( int entnum )
void S_ClearRawChannel( int entnum )
{
rawchan_t *ch;
@ -1320,7 +1320,7 @@ S_SpatializeRawChannels
static void S_SpatializeRawChannels( void )
{
int i;
for( i = 0; i < MAX_RAW_CHANNELS; i++ )
{
rawchan_t *ch = raw_channels[i];
@ -1430,7 +1430,7 @@ void S_StopAllSounds( qboolean ambient )
if( !dma.initialized ) return;
total_channels = MAX_DYNAMIC_CHANNELS; // no statics
for( i = 0; i < MAX_CHANNELS; i++ )
for( i = 0; i < MAX_CHANNELS; i++ )
{
if( !channels[i].sfx ) continue;
S_FreeChannel( &channels[i] );
@ -1471,10 +1471,10 @@ void S_UpdateChannels( void )
if((int)(endtime - soundtime) > samps )
endtime = soundtime + samps;
if(( endtime - paintedtime ) & 0x3 )
{
// the difference between endtime and painted time should align on
// the difference between endtime and painted time should align on
// boundaries of 4 samples. this is important when upsampling from 11khz -> 44khz.
endtime -= ( endtime - paintedtime ) & 0x3;
}
@ -1507,7 +1507,7 @@ update listener position
void S_UpdateFrame( struct ref_viewpass_s *rvp )
{
if( !FBitSet( rvp->flags, RF_DRAW_WORLD ) || FBitSet( rvp->flags, RF_ONLY_CLIENTDRAW ))
return;
return;
VectorCopy( rvp->vieworigin, s_listener.origin );
AngleVectors( rvp->viewangles, s_listener.forward, s_listener.right, s_listener.up );
@ -1550,7 +1550,7 @@ void SND_UpdateSound( void )
combine = NULL;
// update spatialization for static and dynamic sounds
// update spatialization for static and dynamic sounds
for( i = NUM_AMBIENTS, ch = channels + NUM_AMBIENTS; i < total_channels; i++, ch++ )
{
if( !ch->sfx ) continue;
@ -1822,7 +1822,7 @@ qboolean S_Init( void )
s_lerping = Cvar_Get( "s_lerping", "0", FCVAR_ARCHIVE, "apply interpolation to sound output" );
s_ambient_level = Cvar_Get( "ambient_level", "0.3", FCVAR_ARCHIVE, "volume of environment noises (water and wind)" );
s_ambient_fade = Cvar_Get( "ambient_fade", "1000", FCVAR_ARCHIVE, "rate of volume fading when client is moving" );
s_combine_sounds = Cvar_Get( "s_combine_channels", "0", FCVAR_ARCHIVE, "combine channels with same sounds" );
s_combine_sounds = Cvar_Get( "s_combine_channels", "0", FCVAR_ARCHIVE, "combine channels with same sounds" );
snd_mute_losefocus = Cvar_Get( "snd_mute_losefocus", "1", FCVAR_ARCHIVE, "silence the audio when game window loses focus" );
s_test = Cvar_Get( "s_test", "0", 0, "engine developer cvar for quick testing new features" );
s_samplecount = Cvar_Get( "s_samplecount", "0", FCVAR_ARCHIVE, "sample count (0 for default value)" );

View File

@ -109,7 +109,7 @@ void S_TransferPaintBuffer( int endtime )
//===============================================================================
// Mix buffer (paintbuffer) management routines
//===============================================================================
// Activate a paintbuffer. All active paintbuffers are mixed in parallel within
// Activate a paintbuffer. All active paintbuffers are mixed in parallel within
// MIX_MixChannelsToPaintbuffer, according to flags
_inline void MIX_ActivatePaintbuffer( int ipaintbuffer )
{
@ -146,7 +146,7 @@ _inline int MIX_GetCurrentPaintbufferIndex( void )
_inline paintbuffer_t *MIX_GetCurrentPaintbufferPtr( void )
{
int ipaint = MIX_GetCurrentPaintbufferIndex();
Assert( ipaint < CPAINTBUFFERS );
return &paintbuffers[ipaint];
}
@ -183,7 +183,7 @@ _inline portable_samplepair_t *MIX_GetPFrontFromIPaint( int ipaintbuffer )
}
_inline paintbuffer_t *MIX_GetPPaintFromIPaint( int ipaint )
{
{
Assert( ipaint < CPAINTBUFFERS );
return &paintbuffers[ipaint];
}
@ -203,7 +203,7 @@ void MIX_InitAllPaintbuffers( void )
paintbuffers[IPAINTBUFFER].pbuf = paintbuffer;
paintbuffers[IROOMBUFFER].pbuf = roombuffer;
paintbuffers[ISTREAMBUFFER].pbuf = streambuffer;
MIX_SetCurrentPaintbuffer( IPAINTBUFFER );
}
@ -218,7 +218,7 @@ void S_PaintMonoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, in
{
int *lscale, *rscale;
int i, data;
lscale = snd_scaletable[volume[0] >> SND_SCALE_SHIFT];
rscale = snd_scaletable[volume[1] >> SND_SCALE_SHIFT];
@ -272,7 +272,7 @@ void S_PaintStereoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData
int i;
data = (uint *)pData;
for( i = 0; i < outCount; i++, data++ )
{
left = (signed short)((*data & 0x0000FFFF));
@ -425,7 +425,7 @@ int S_MixDataToDevice( channel_t *pChannel, int sampleCount, int outRate, int ou
int startingOffset = outOffset;
float inputRate = ( pChannel->pitch * pChannel->sfx->cache->rate );
float rate = inputRate / outRate;
// shouldn't be playing this if finished, but return if we are
if( pChannel->pMixer.finished )
return 0;
@ -528,7 +528,7 @@ qboolean S_ShouldContinueMixing( channel_t *ch )
// flags: if SOUND_MIX_DRY, then mix only samples with channel flagged as 'dry'
// outputRate: target mix rate for all samples. Note, if outputRate = SOUND_DMA_SPEED, then
// this routine will fill the paintbuffer to endtime. Otherwise, fewer samples are mixed.
// if( endtime - paintedtime ) is not aligned on boundaries of 4,
// if( endtime - paintedtime ) is not aligned on boundaries of 4,
// we'll miss data if outputRate < SOUND_DMA_SPEED!
void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
{
@ -539,16 +539,16 @@ void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
// mix each channel into paintbuffer
ch = channels;
// validate parameters
Assert( outputRate <= SOUND_DMA_SPEED );
// make sure we're not discarding data
Assert( !(( endtime - paintedtime ) & 0x3 ) || ( outputRate == SOUND_DMA_SPEED ));
// 44k: try to mix this many samples at outputRate
sampleCount = ( endtime - paintedtime ) / ( SOUND_DMA_SPEED / outputRate );
if( sampleCount <= 0 ) return;
for( i = 0; i < total_channels; i++, ch++ )
@ -578,10 +578,10 @@ void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
pSource = S_LoadSound( ch->sfx );
// Don't mix sound data for sounds with zero volume. If it's a non-looping sound,
// Don't mix sound data for sounds with zero volume. If it's a non-looping sound,
// just remove the sound when its volume goes to zero.
bZeroVolume = !ch->leftvol && !ch->rightvol;
if( !bZeroVolume )
{
// this values matched with GoldSrc
@ -647,7 +647,7 @@ _inline portable_samplepair_t *S_GetNextpFilter( int i, portable_samplepair_t *p
if( i == 0 ) return (&(pfiltermem[1]));
if( i == 1 ) return (&(pfiltermem[2]));
// return from paintbuffer, where samples are doubled.
// return from paintbuffer, where samples are doubled.
// even samples are to be replaced with interpolated value.
return (&(pbuffer[(i-2) * 2 + 1]));
}
@ -708,32 +708,32 @@ void S_Interpolate2xCubic( portable_samplepair_t *pbuffer, portable_samplepair_t
x0 = psamp1->left;
x1 = psamp2->left;
x2 = psamp3->left;
// interpolate
a = (3 * (x0-x1) - xm1 + x2) / 2;
b = 2*x1 + xm1 - (5*x0 + x2) / 2;
c = (x1 - xm1) / 2;
// write out interpolated sample
temppaintbuffer[outpos].left = a/8 + b/4 + c/2 + x0;
// get all right samples for window
xm1 = psamp0->right;
x0 = psamp1->right;
x1 = psamp2->right;
x2 = psamp3->right;
// interpolate
a = (3 * (x0-x1) - xm1 + x2) / 2;
b = 2*x1 + xm1 - (5*x0 + x2) / 2;
c = (x1 - xm1) / 2;
// write out interpolated sample, increment output counter
temppaintbuffer[outpos++].right = a/8 + b/4 + c/2 + x0;
Assert( outpos <= ( sizeof( temppaintbuffer ) / sizeof( temppaintbuffer[0] )));
}
Assert( cfltmem >= 3 );
// save last 3 samples from paintbuffer
@ -770,7 +770,7 @@ void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_
}
// save last value to be played out in buffer
*pfiltermem = pbuffer[upCount - 1];
*pfiltermem = pbuffer[upCount - 1];
}
// upsample by 2x, optionally using interpolation
@ -783,11 +783,11 @@ void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_
void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int filtertype )
{
int upCount = count<<1;
int i, j;
int i, j;
// reverse through buffer, duplicating contents for 'count' samples
for( i = upCount - 1, j = count - 1; j >= 0; i-=2, j-- )
{
{
pbuffer[i] = pbuffer[j];
pbuffer[i-1] = pbuffer[j];
}
@ -839,7 +839,7 @@ void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgai
int i, gain;
gain = 256 * fgain;
Assert( count <= PAINTBUFFER_SIZE );
Assert( ibuf1 < CPAINTBUFFERS );
Assert( ibuf2 < CPAINTBUFFERS );
@ -848,8 +848,8 @@ void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgai
pbuf1 = paintbuffers[ibuf1].pbuf;
pbuf2 = paintbuffers[ibuf2].pbuf;
pbuf3 = paintbuffers[ibuf3].pbuf;
// destination buffer stereo - average n chans down to stereo
// destination buffer stereo - average n chans down to stereo
// destination 2ch:
// pb1 2ch + pb2 2ch -> pb3 2ch
@ -874,7 +874,7 @@ void MIX_CompressPaintbuffer( int ipaint, int count )
ppaint = MIX_GetPPaintFromIPaint( ipaint );
pbuf = ppaint->pbuf;
for( i = 0; i < count; i++, pbuf++ )
{
pbuf->left = CLIP( pbuf->left );
@ -909,7 +909,7 @@ void MIX_MixStreamBuffer( int end )
memset( pbuf, 0, (end - paintedtime) * sizeof( portable_samplepair_t ));
}
else
{
{
int i, stop;
// copy from the streaming sound source
@ -919,7 +919,7 @@ void MIX_MixStreamBuffer( int end )
{
pbuf[i-paintedtime].left = ( ch->rawsamples[i & ( ch->max_samples - 1 )].left * ch->leftvol ) >> 8;
pbuf[i-paintedtime].right = ( ch->rawsamples[i & ( ch->max_samples - 1 )].right * ch->rightvol ) >> 8;
}
}
for( ; i < end; i++ )
pbuf[i-paintedtime].left = pbuf[i-paintedtime].right = 0;
@ -985,7 +985,7 @@ void MIX_UpsampleAllPaintbuffers( int end, int count )
// only mix to roombuffer if dsp fx are on KDB: perf
MIX_ActivatePaintbuffer( IROOMBUFFER ); // operates on MIX_MixChannelsToPaintbuffer
// mix 11khz sounds:
// mix 11khz sounds:
MIX_MixChannelsToPaintbuffer( end, SOUND_11k, SOUND_11k );
// upsample all 11khz buffers by 2x
@ -993,9 +993,9 @@ void MIX_UpsampleAllPaintbuffers( int end, int count )
MIX_SetCurrentPaintbuffer( IROOMBUFFER ); // operates on MixUpSample
S_MixUpsample( count / ( SOUND_DMA_SPEED / SOUND_11k ), s_lerping->value );
// mix 22khz sounds:
// mix 22khz sounds:
MIX_MixChannelsToPaintbuffer( end, SOUND_22k, SOUND_22k );
// upsample all 22khz buffers by 2x
// only upsample roombuffer if dsp fx are on KDB: perf
MIX_SetCurrentPaintbuffer( IROOMBUFFER );
@ -1040,7 +1040,7 @@ void MIX_PaintChannels( int endtime )
MIX_MixPaintbuffers( IPAINTBUFFER, IROOMBUFFER, IPAINTBUFFER, count, S_GetMasterVolume() );
// add music or soundtrack from movie (no dsp)
MIX_MixPaintbuffers( IPAINTBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, S_GetMusicVolume() );
MIX_MixPaintbuffers( IPAINTBUFFER, ISTREAMBUFFER, IPAINTBUFFER, count, S_GetMusicVolume() );
// clip all values > 16 bit down to 16 bit
MIX_CompressPaintbuffer( IPAINTBUFFER, count );

View File

@ -36,10 +36,10 @@ int S_ZeroCrossingBefore( wavdata_t *pWaveData, int sample )
sampleSize = pWaveData->width * pWaveData->channels;
// this can never be zero -- other functions divide by this.
// this can never be zero -- other functions divide by this.
// This should never happen, but avoid crashing
if( sampleSize <= 0 ) sampleSize = 1;
if( pWaveData->width == 1 )
{
signed char *pData = (signed char *)(pWaveData->buffer + sample * sampleSize);
@ -133,7 +133,7 @@ int S_ZeroCrossingAfter( wavdata_t *pWaveData, int sample )
sampleSize = pWaveData->width * pWaveData->channels;
// this can never be zero -- other functions divide by this.
// this can never be zero -- other functions divide by this.
// This should never happen, but avoid crashing
if( sampleSize <= 0 ) sampleSize = 1;
@ -232,7 +232,7 @@ int S_ConvertLoopedPosition( wavdata_t *pSource, int samplePosition, qboolean us
// subtract off starting bit of the wave
samplePosition -= pSource->loopStart;
if( loopSize )
{
// "real" position in memory (mod off extra loops)
@ -264,7 +264,7 @@ int S_GetOutputData( wavdata_t *pSource, void **pData, int samplePosition, int s
sampleSize = pSource->width * pSource->channels;
// this can never be zero -- other functions divide by this.
// this can never be zero -- other functions divide by this.
// This should never happen, but avoid crashing
if( sampleSize <= 0 ) sampleSize = 1;

View File

@ -115,7 +115,7 @@ char *VOX_LookupString( const char *pSentenceName, int *psentencenum )
if( Q_isdigit( pSentenceName ) && (i = Q_atoi( pSentenceName )) < g_numSentences )
{
if( psentencenum ) *psentencenum = i;
return (g_Sentences[i].pName + Q_strlen( g_Sentences[i].pName ) + 1 );
return (g_Sentences[i].pName + Q_strlen( g_Sentences[i].pName ) + 1 );
}
for( i = 0; i < g_numSentences; i++ )
@ -133,7 +133,7 @@ char *VOX_LookupString( const char *pSentenceName, int *psentencenum )
// parse a null terminated string of text into component words, with
// pointers to each word stored in rgpparseword
// note: this code actually alters the passed in string!
char **VOX_ParseString( char *psz )
char **VOX_ParseString( char *psz )
{
int i, fdone = 0;
char c, *p = psz;
@ -151,7 +151,7 @@ char **VOX_ParseString( char *psz )
c = *p;
while( c && !IsNextWord( c ))
c = *(++p);
// if '(' then scan for matching ')'
if( c == '(' )
{
@ -165,7 +165,7 @@ char **VOX_ParseString( char *psz )
fdone = 1;
}
else
{
{
// if . or , insert pause into rgpparseword,
// unless this is the last character
if(( c == '.' || c == ',' ) && *(p+1) != '\n' && *(p+1) != '\r' && *(p+1) != 0 )
@ -237,9 +237,9 @@ float VOX_ModifyPitch( channel_t *ch, float pitch )
//===============================================================================
// Get any pitch, volume, start, end params into voxword
// and null out trailing format characters
// Format:
// Format:
// someword(v100 p110 s10 e20)
//
//
// v is volume, 0% to n%
// p is pitch shift up 0% to n%
// s is start wave offset %
@ -249,20 +249,20 @@ float VOX_ModifyPitch( channel_t *ch, float pitch )
// pass fFirst == 1 if this is the first string in sentence
// returns 1 if valid string, 0 if parameter block only.
//
// If a ( xxx ) parameter block does not directly follow a word,
// If a ( xxx ) parameter block does not directly follow a word,
// then that 'default' parameter block will be used as the default value
// for all following words. Default parameter values are reset
// by another 'default' parameter block. Default parameter values
// for a single word are overridden for that word if it has a parameter block.
//
//
//===============================================================================
int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
{
char *pszsave = psz;
char c, ct, sznum[8];
static voxword_t voxwordDefault;
int i;
// init to defaults if this is the first word in string.
if( fFirst )
{
@ -276,12 +276,12 @@ int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
*pvoxword = voxwordDefault;
// look at next to last char to see if we have a
// look at next to last char to see if we have a
// valid format:
c = *( psz + Q_strlen( psz ) - 1 );
// no formatting, return
if( c != ')' ) return 1;
if( c != ')' ) return 1;
// scan forward to first '('
c = *psz;
@ -290,7 +290,7 @@ int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
// bogus formatting
if( c == ')' ) return 0;
// null terminate
*psz = 0;
ct = *(++psz);
@ -300,7 +300,7 @@ int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
// scan until we hit a character in the commandSet
while( ct && !IsCommandChar( ct ))
ct = *(++psz);
if( ct == ')' )
break;
@ -308,7 +308,7 @@ int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst )
i = 0;
c = *(++psz);
if( !isdigit( c ))
break;
@ -359,8 +359,8 @@ void VOX_LoadWord( channel_t *pchan )
// apply mixer
pchan->currentWord = &pchan->pMixer;
pchan->currentWord->pData = pSource;
pchan->currentWord->pData = pSource;
// don't allow overlapped ranges
if( end <= start ) end = 0;
@ -411,7 +411,7 @@ void VOX_LoadFirstWord( channel_t *pchan, voxword_t *pwords )
{
pchan->words[i] = pwords[i];
i++;
}
}
pchan->words[i].sfx = NULL;
pchan->wordIndex = 0;
@ -467,7 +467,7 @@ void VOX_LoadSound( channel_t *pchan, const char *pszin )
memset( rgvoxword, 0, sizeof( voxword_t ) * CVOXWORDMAX );
memset( buffer, 0, sizeof( buffer ));
// lookup actual string in g_Sentences,
// lookup actual string in g_Sentences,
// set pointer to string data
psz = VOX_LookupString( pszin, NULL );
@ -494,7 +494,7 @@ void VOX_LoadSound( channel_t *pchan, const char *pszin )
VOX_ParseString( psz );
// for each word in the sentence, construct the filename,
// lookup the sfx and save each pointer in a temp array
// lookup the sfx and save each pointer in a temp array
i = 0;
cword = 0;
@ -527,7 +527,7 @@ void VOX_LoadSound( channel_t *pchan, const char *pszin )
// {}. The string is rewritten in place with those commands removed.
//
// Input : *pSentenceData - sentence data to be modified in place
// sentenceIndex - global sentence table index for any data that is
// sentenceIndex - global sentence table index for any data that is
// parsed out
//-----------------------------------------------------------------------------
void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex )
@ -555,15 +555,15 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex )
// Copy good string to temp buffer
memcpy( tempBuffer + tempBufferPos, pSentenceData, length );
// move the copy position
tempBufferPos += length;
pSentenceData = pNext;
// skip ahead of the opening brace
if( *pSentenceData ) pSentenceData++;
// skip whitespace
while( *pSentenceData && *pSentenceData <= 32 )
pSentenceData++;
@ -584,7 +584,7 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex )
}
pSentenceData = ScanForwardUntil( pSentenceData, '}' );
// skip the closing brace
if( *pSentenceData ) pSentenceData++;
@ -597,7 +597,7 @@ void VOX_ParseLineCommands( char *pSentenceData, int sentenceIndex )
{
// terminate cleaned up copy
tempBuffer[tempBufferPos] = 0;
// copy it over the original data
Q_strcpy( pStart, tempBuffer );
}
@ -661,7 +661,7 @@ void VOX_ReadSentenceFile( const char *psentenceFileName )
// scan forward to end of sentence or eof
while( pch < pchlast && pch[0] != '\n' && pch[0] != '\r' )
pch++;
// insert null terminator
if( pch < pchlast ) *pch++ = 0;

View File

@ -155,7 +155,7 @@ typedef struct channel_s
int rightvol; // 0-255 right volume
int entnum; // entity soundsource
int entchannel; // sound channel (CHAN_STREAM, CHAN_VOICE, etc.)
int entchannel; // sound channel (CHAN_STREAM, CHAN_VOICE, etc.)
vec3_t origin; // only use if fixed_origin is set
float dist_mult; // distance multiplier (attenuation/clipK)
int master_vol; // 0-255 master volume

View File

@ -32,7 +32,7 @@ static int IsComment( const char *pText )
if( length >= 2 && pText[0] == '/' && pText[1] == '/' )
return 1;
// no text?
if( length > 0 )
return 0;
@ -213,7 +213,7 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
char buf[512], trim[512], currentName[512];
char *pCurrentText = NULL, *pNameHeap;
char nameHeap[32768]; // g-cont. i will scale up heap to handle all TFC messages
int mode = MSGFILE_NAME; // searching for a message name
int mode = MSGFILE_NAME; // searching for a message name
int lineNumber, filePos, lastLinePos;
client_textmessage_t textMessages[MAX_MESSAGES];
int i, nameHeapSize, textHeapSize, messageSize, nameOffset;
@ -318,10 +318,10 @@ void CL_TextMessageParse( byte *pMemFile, int fileSize )
// must malloc because we need to be able to clear it after initialization
clgame.titles = (client_textmessage_t *)Mem_Calloc( cls.mempool, textHeapSize + nameHeapSize + messageSize );
// copy table over
memcpy( clgame.titles, textMessages, messageSize );
// copy Name heap
pNameHeap = ((char *)clgame.titles) + messageSize;
memcpy( pNameHeap, nameHeap, nameHeapSize );

View File

@ -93,7 +93,7 @@ void GAME_EXPORT VGUI_CursorSelect(enum VGUI_DefaultCursor cursor )
qboolean visible;
if( cls.key_dest != key_game || cl.paused )
return;
switch( cursor )
{
case dc_user:
@ -285,7 +285,7 @@ void VGui_Startup( const char *clientlib, int width, int height )
if( !s_pVGuiSupport )
{
if( FS_FileExists( vguiloader, false ) )
Con_Reportf( S_ERROR "Failed to load vgui_support library: %s", COM_GetLibraryError() );
Con_Reportf( S_ERROR "Failed to load vgui_support library: %s\n", COM_GetLibraryError() );
else
Con_Reportf( "vgui_support: not found\n" );
}

View File

@ -75,7 +75,7 @@ Cbuf_GetSpace
void *Cbuf_GetSpace( cmdbuf_t *buf, int length )
{
void *data;
if(( buf->cursize + length ) > buf->maxsize )
{
buf->cursize = 0;
@ -84,7 +84,7 @@ void *Cbuf_GetSpace( cmdbuf_t *buf, int length )
data = buf->data + buf->cursize;
buf->cursize += length;
return data;
}
@ -249,13 +249,13 @@ void Cbuf_ExecStuffCmds( void )
if( l + Q_strlen( host.argv[i] ) + 4 > sizeof( build ) - 1 )
break;
build[l++] = ' ';
if( Q_strchr( host.argv[i], ' ' ))
build[l++] = '\"';
for( j = 0; host.argv[i][j]; j++ )
build[l++] = host.argv[i][j];
if( Q_strchr( host.argv[i], ' ' ))
build[l++] = '\"';
}
@ -321,7 +321,7 @@ Just prints the rest of the line to the console
void Cmd_Echo_f( void )
{
int i;
for( i = 1; i < Cmd_Argc(); i++ )
Con_Printf( "%s", Cmd_Argv( i ));
Con_Printf( "\n" );
@ -487,7 +487,7 @@ const char *Cmd_Argv( int arg )
{
if((uint)arg >= cmd_argc )
return "";
return cmd_argv[arg];
return cmd_argv[arg];
}
/*
@ -772,7 +772,7 @@ void Cmd_LookupCmds( void *buffer, void *ptr, setpair_t callback )
// nothing to process ?
if( !callback ) return;
for( cmd = cmd_functions; cmd; cmd = cmd->next )
{
if( !buffer ) callback( cmd->name, (char *)cmd->function, cmd->desc, ptr );
@ -860,7 +860,7 @@ void Cmd_If_f( void )
if(( cmd_argv[2][0] == '>' ) && ( f1 > f2 )) // >, >=
cmd_condition |= BIT( cmd_condlevel );
if(( cmd_argv[2][0] == '<' ) && ( f1 < f2 )) // <, <=
cmd_condition |= BIT( cmd_condlevel );
}
@ -886,7 +886,7 @@ A complete command line has been parsed, so try to execute it
============
*/
void Cmd_ExecuteString( char *text )
{
{
cmd_t *cmd = NULL;
cmdalias_t *a = NULL;
convar_t *cvar = NULL;
@ -940,7 +940,7 @@ void Cmd_ExecuteString( char *text )
}
// execute the command line
Cmd_TokenizeString( text );
Cmd_TokenizeString( text );
if( !Cmd_Argc( )) return; // no tokens
@ -1026,7 +1026,7 @@ so when they are typed in at the console, they will need to be forwarded.
void Cmd_ForwardToServer( void )
{
char str[MAX_CMD_BUFFER];
if( cls.demoplayback )
{
if( !Q_stricmp( Cmd_Argv( 0 ), "pause" ))
@ -1049,7 +1049,7 @@ void Cmd_ForwardToServer( void )
Q_strcat( str, Cmd_Argv( 0 ));
Q_strcat( str, " " );
}
if( Cmd_Argc() > 1 )
Q_strcat( str, Cmd_Args( ));
else Q_strcat( str, "\n" );

View File

@ -125,7 +125,7 @@ float GAME_EXPORT COM_RandomFloat( float flLow, float flHigh )
int GAME_EXPORT COM_RandomLong( int lLow, int lHigh )
{
dword maxAcceptable;
dword n, x = lHigh - lLow + 1;
dword n, x = lHigh - lLow + 1;
if( idum == 0 ) COM_SetRandomSeed( 0 );
@ -184,7 +184,7 @@ typedef struct
typedef struct
{
lzss_list_t *hash_table;
lzss_list_t *hash_table;
lzss_node_t *hash_node;
int window_size;
} lzss_state_t;
@ -247,7 +247,7 @@ byte *LZSS_CompressNoAlloc( lzss_state_t *state, byte *pInput, int input_length,
lzss_header_t *header = (lzss_header_t *)pStart;
byte *pOutput = pStart + sizeof( lzss_header_t );
const byte *pEncodedPosition = NULL;
byte *pLookAhead = pInput;
byte *pLookAhead = pInput;
byte *pWindow = pInput;
int i, putCmdByte = 0;
byte *pCmdByte = NULL;
@ -309,9 +309,9 @@ byte *LZSS_CompressNoAlloc( lzss_state_t *state, byte *pInput, int input_length,
*pCmdByte = (*pCmdByte >> 1) | 0x80;
*pOutput++ = (( pLookAhead - pEncodedPosition - 1 ) >> LZSS_LOOKSHIFT );
*pOutput++ = (( pLookAhead - pEncodedPosition - 1 ) << LZSS_LOOKSHIFT ) | ( encoded_length - 1 );
}
else
{
}
else
{
*pCmdByte = ( *pCmdByte >> 1 );
*pOutput++ = *pLookAhead;
encoded_length = 1;
@ -392,7 +392,7 @@ uint LZSS_Decompress( const byte *pInput, byte *pOutput )
while( 1 )
{
if( !getCmdByte )
if( !getCmdByte )
cmdByte = *pInput++;
getCmdByte = ( getCmdByte + 1 ) & 0x07;
@ -405,15 +405,15 @@ uint LZSS_Decompress( const byte *pInput, byte *pOutput )
position |= ( *pInput >> LZSS_LOOKSHIFT );
count = ( *pInput++ & 0x0F ) + 1;
if( count == 1 )
if( count == 1 )
break;
pSource = pOutput - position - 1;
for( i = 0; i < count; i++ )
*pOutput++ = *pSource++;
totalBytes += count;
}
else
}
else
{
*pOutput++ = *pInput++;
totalBytes++;
@ -482,10 +482,10 @@ char *COM_ParseFile( char *data, char *token )
if( !token )
return NULL;
len = 0;
token[0] = 0;
if( !data )
return NULL;
// skip whitespace
@ -496,7 +496,7 @@ skipwhite:
return NULL; // end of file;
data++;
}
// skip // comments
if( c=='/' && data[1] == '/' )
{
@ -551,7 +551,7 @@ skipwhite:
if( COM_IsSingleChar( c ))
break;
} while( c > 32 );
token[len] = 0;
return data;
@ -665,7 +665,7 @@ int GAME_EXPORT COM_ExpandFilename( const char *fileName, char *nameOutBuffer, i
// models\barney.mdl - D:\Xash3D\bshift\models\barney.mdl
if(( path = FS_GetDiskPath( fileName, false )) != NULL )
{
Q_sprintf( result, "%s/%s", host.rootdir, path );
Q_sprintf( result, "%s/%s", host.rootdir, path );
// check for enough room
if( Q_strlen( result ) > nameOutBufferSize )
@ -771,7 +771,7 @@ void COM_HexConvert( const char *pszInput, int nInputLength, byte *pOutput )
for( i = 0; i < nInputLength; i += 2 )
{
pIn = &pszInput[i];
*p = COM_Nibble( pIn[0] ) << 4 | COM_Nibble( pIn[1] );
*p = COM_Nibble( pIn[0] ) << 4 | COM_Nibble( pIn[1] );
p++;
}
}
@ -817,7 +817,7 @@ char *COM_MemFgets( byte *pMemFile, int fileSize, int *filePos, char *pBuffer, i
// copy it out
memcpy( pBuffer, pMemFile + *filePos, size );
// If the buffer isn't full, terminate (this is always true)
if( size < bufferSize ) pBuffer[size] = 0;
@ -925,7 +925,7 @@ COM_FreeFile
*/
void GAME_EXPORT COM_FreeFile( void *buffer )
{
free( buffer );
free( buffer );
}
/*

View File

@ -94,13 +94,13 @@ enum
{
D_INFO = 1, // "-dev 1", shows various system messages
D_WARN, // "-dev 2", shows not critical system warnings
D_ERROR, // "-dev 3", shows critical warnings
D_ERROR, // "-dev 3", shows critical warnings
D_REPORT, // "-dev 4", special case for game reports
D_NOTE // "-dev 5", show system notifications for engine developers
};
typedef enum
{
{
HOST_NORMAL, // listen server, singleplayer
HOST_DEDICATED,
} instance_t;
@ -138,16 +138,16 @@ typedef enum
#define CIN_MAIN 0
#define CIN_LOGO 1
#if XASH_LOW_MEMORY == 0
#define MAX_DECALS 512 // touching TE_DECAL messages, etc
#define MAX_STATIC_ENTITIES 3096 // static entities that moved on the client when level is spawn
#elif XASH_LOW_MEMORY == 2
#define MAX_DECALS 256 // touching TE_DECAL messages, etc
#define MAX_STATIC_ENTITIES 32 // static entities that moved on the client when level is spawn
#elif XASH_LOW_MEMORY == 1
#define MAX_DECALS 512 // touching TE_DECAL messages, etc
#define MAX_STATIC_ENTITIES 128 // static entities that moved on the client when level is spawn
#elif XASH_LOW_MEMORY == 2
#define MAX_DECALS 256 // touching TE_DECAL messages, etc
#define MAX_STATIC_ENTITIES 32 // static entities that moved on the client when level is spawn
#endif
// filesystem flags
@ -205,7 +205,7 @@ typedef struct gameinfo_s
// filesystem info
char gamefolder[MAX_QPATH]; // used for change game '-game x'
char basedir[MAX_QPATH]; // base game directory (like 'id1' for Quake or 'valve' for Half-Life)
char falldir[MAX_QPATH]; // used as second basedir
char falldir[MAX_QPATH]; // used as second basedir
char startmap[MAX_QPATH];// map to start singleplayer game
char trainmap[MAX_QPATH];// map to start hazard course (if specified)
char title[64]; // Game Main Title
@ -270,14 +270,14 @@ typedef enum
{
HOST_INIT = 0, // initalize operations
HOST_FRAME, // host running
HOST_SHUTDOWN, // shutdown operations
HOST_SHUTDOWN, // shutdown operations
HOST_ERR_FATAL, // sys error
HOST_SLEEP, // sleeped by different reason, e.g. minimize window
HOST_NOFOCUS, // same as HOST_FRAME, but disable mouse
HOST_CRASHED // an exception handler called
} host_status_t;
typedef enum
typedef enum
{
STATE_RUNFRAME = 0,
STATE_LOAD_LEVEL,
@ -385,7 +385,7 @@ typedef struct host_parm_s
{
HINSTANCE hInst;
HANDLE hMutex;
host_status_t status; // global host state
game_status_t game; // game manager
uint type; // running at
@ -444,7 +444,7 @@ typedef struct host_parm_s
char rootdir[MAX_OSPATH]; // member root directory
char rodir[MAX_OSPATH]; // readonly root
char gamefolder[MAX_QPATH]; // it's a default gamefolder
char gamefolder[MAX_QPATH]; // it's a default gamefolder
byte *imagepool; // imagelib mempool
byte *soundpool; // soundlib mempool

View File

@ -67,15 +67,15 @@ qboolean Cmd_GetMapList( const char *s, char *completedname, int length )
t = FS_Search( va( "maps/%s*.bsp", s ), true, con_gamemaps->value );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
for( i = 0, nummaps = 0; i < t->numfilenames; i++ )
{
char entfilename[MAX_QPATH];
const char *ext = COM_FileExtension( t->filenames[i] );
const char *ext = COM_FileExtension( t->filenames[i] );
int ver = -1, lumpofs = 0, lumplen = 0;
char *ents = NULL, *pfile;
qboolean validmap = false;
@ -89,7 +89,7 @@ qboolean Cmd_GetMapList( const char *s, char *completedname, int length )
generator[0] = '\0';
f = FS_Open( t->filenames[i], "rb", con_gamemaps->value );
if( f )
{
dheader_t *header;
@ -212,7 +212,7 @@ qboolean Cmd_GetDemoList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s*.dem", s ), true, true );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -258,7 +258,7 @@ qboolean Cmd_GetMovieList( const char *s, char *completedname, int length )
t = FS_Search( va( "media/%s*.avi", s ), true, false );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -305,14 +305,14 @@ qboolean Cmd_GetMusicList( const char *s, char *completedname, int length )
t = FS_Search( va( "media/%s*.*", s ), true, false );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
for(i = 0, numtracks = 0; i < t->numfilenames; i++)
{
const char *ext = COM_FileExtension( t->filenames[i] );
const char *ext = COM_FileExtension( t->filenames[i] );
if( Q_stricmp( ext, "wav" ) && Q_stricmp( ext, "mp3" ))
continue;
@ -353,7 +353,7 @@ qboolean Cmd_GetSavesList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s%s*.sav", DEFAULT_SAVE_DIRECTORY, s ), true, true ); // lookup only in gamedir
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -400,7 +400,7 @@ qboolean Cmd_GetConfigList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s*.cfg", s ), true, false );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -447,20 +447,20 @@ qboolean Cmd_GetSoundList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s%s*.*", DEFAULT_SOUNDPATH, s ), true, false );
if( !t ) return false;
Q_strncpy( matchbuf, t->filenames[0] + sizeof( DEFAULT_SOUNDPATH ) - 1, MAX_STRING );
COM_StripExtension( matchbuf );
Q_strncpy( matchbuf, t->filenames[0] + sizeof( DEFAULT_SOUNDPATH ) - 1, MAX_STRING );
COM_StripExtension( matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
for(i = 0, numsounds = 0; i < t->numfilenames; i++)
{
const char *ext = COM_FileExtension( t->filenames[i] );
const char *ext = COM_FileExtension( t->filenames[i] );
if( Q_stricmp( ext, "wav" ) && Q_stricmp( ext, "mp3" ))
continue;
Q_strncpy( matchbuf, t->filenames[i] + sizeof( DEFAULT_SOUNDPATH ) - 1, MAX_STRING );
Q_strncpy( matchbuf, t->filenames[i] + sizeof( DEFAULT_SOUNDPATH ) - 1, MAX_STRING );
COM_StripExtension( matchbuf );
Con_Printf( "%16s\n", matchbuf );
numsounds++;
@ -500,7 +500,7 @@ qboolean Cmd_GetItemsList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s/%s*.txt", clgame.itemspath, s ), true, false );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -692,7 +692,7 @@ qboolean Cmd_GetCustomList( const char *s, char *completedname, int length )
t = FS_Search( va( "%s*.hpk", s ), true, false );
if( !t ) return false;
COM_FileBase( t->filenames[0], matchbuf );
COM_FileBase( t->filenames[0], matchbuf );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( t->numfilenames == 1 ) return true;
@ -746,18 +746,18 @@ qboolean Cmd_GetGamesList( const char *s, char *completedname, int length )
for( i = 0, numgamedirs = 0; i < SI.numgames; i++ )
{
if(( *s == '*' ) || !Q_strnicmp( SI.games[i]->gamefolder, s, len))
Q_strcpy( gamedirs[numgamedirs++], SI.games[i]->gamefolder );
Q_strcpy( gamedirs[numgamedirs++], SI.games[i]->gamefolder );
}
if( !numgamedirs ) return false;
Q_strncpy( matchbuf, gamedirs[0], MAX_STRING );
Q_strncpy( matchbuf, gamedirs[0], MAX_STRING );
if( completedname && length )
Q_strncpy( completedname, matchbuf, length );
if( numgamedirs == 1 ) return true;
for( i = 0; i < numgamedirs; i++ )
{
Q_strncpy( matchbuf, gamedirs[i], MAX_STRING );
Q_strncpy( matchbuf, gamedirs[i], MAX_STRING );
Con_Printf( "%16s\n", matchbuf );
}
@ -848,7 +848,7 @@ qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir )
file_t *f;
if( FS_FileSize( "maps.lst", onlyingamedir ) > 0 && !fRefresh )
return true; // exist
return true; // exist
// setup mpfilter
size = Q_snprintf( mpfilter, sizeof( mpfilter ), "maps/%s", GI->mp_filter );
@ -1043,7 +1043,7 @@ qboolean Cmd_AutocompleteName( const char *source, int arg, char *buffer, size_t
for( list = cmd_list; list->name; list++ )
{
if( list->arg == arg && Cmd_CheckName( list->name ))
return list->func( source, buffer, bufsize );
return list->func( source, buffer, bufsize );
}
return false;
@ -1309,7 +1309,7 @@ static void Cmd_WriteHelp(const char *name, const char *unused, const char *desc
if( !desc || !Q_strcmp( desc, "" ))
return; // ignore fantom cmds
if( name[0] == '+' || name[0] == '-' )
return; // key bindings
return; // key bindings
length = 3 - (Q_strlen( name ) / 10); // Asm_Ed default tab stop is 10
@ -1374,7 +1374,7 @@ void Host_WriteConfig( void )
jlook = (kbutton_t *)clgame.dllFuncs.KB_Find( "in_jlook" );
}
if( mlook && ( mlook->state & 1 ))
if( mlook && ( mlook->state & 1 ))
FS_Printf( f, "+mlook\n" );
if( jlook && ( jlook->state & 1 ))
@ -1407,7 +1407,7 @@ void GAME_EXPORT Host_WriteServerConfig( const char *name )
// FIXME: move this out until menu parser is done
CSCR_LoadDefaultCVars( "settings.scr" );
if(( f = FS_Open( newconfigfile, "w", false )) != NULL )
{
FS_Printf( f, "//=======================================================================\n" );

View File

@ -338,7 +338,7 @@ The flags will be or'ed in if the variable exists.
convar_t *Cvar_Get( const char *name, const char *value, int flags, const char *var_desc )
{
convar_t *cur, *find, *var;
ASSERT( name && *name );
// check for command coexisting
@ -463,13 +463,13 @@ void Cvar_RegisterVariable( convar_t *var )
if( FBitSet( var->flags, FCVAR_EXTENDED ))
var->def_string = var->string; // just swap pointers
var->string = copystring( var->string );
var->string = copystring( var->string );
var->value = Q_atof( var->string );
// find the supposed position in chain (alphanumerical order)
for( cur = NULL, find = cvar_vars; find && Q_strcmp( find->name, var->name ) < 0; cur = find, find = find->next );
// now link variable
// now link variable
if( cur ) cur->next = var;
else cvar_vars = var;
var->next = find;
@ -496,7 +496,7 @@ way to change value for many cvars
void Cvar_DirectSet( convar_t *var, const char *value )
{
const char *pszValue;
if( !var ) return; // ???
// lookup for registration
@ -515,7 +515,7 @@ void Cvar_DirectSet( convar_t *var, const char *value )
Con_Printf( "%s is read-only.\n", var->name );
return;
}
if( FBitSet( var->flags, FCVAR_CHEAT ) && !host.allow_cheats )
{
Con_Printf( "%s is cheat protected.\n", var->name );
@ -619,7 +619,7 @@ Cvar_SetValue
void GAME_EXPORT Cvar_SetValue( const char *var_name, float value )
{
char val[32];
if( fabs( value - (int)value ) < 0.000001 )
Q_snprintf( val, sizeof( val ), "%d", (int)value );
else Q_snprintf( val, sizeof( val ), "%f", value );
@ -816,7 +816,7 @@ with the specified flag set to true.
void Cvar_WriteVariables( file_t *f, int group )
{
convar_t *var;
for( var = cvar_vars; var; var = var->next )
{
if( FBitSet( var->flags, group ))
@ -954,7 +954,7 @@ void Cvar_Init( void )
{
cvar_vars = NULL;
cmd_scripting = Cvar_Get( "cmd_scripting", "0", FCVAR_ARCHIVE, "enable simple condition checking and variable operations" );
Cvar_RegisterVariable (&host_developer); // early registering for dev
Cvar_RegisterVariable (&host_developer); // early registering for dev
Cmd_AddCommand( "setgl", Cvar_SetGL_f, "change the value of a opengl variable" ); // OBSOLETE
Cmd_AddCommand( "toggle", Cvar_Toggle_f, "toggles a console variable's values (use for more info)" );

View File

@ -11,7 +11,7 @@ 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.
*/
*/
#if XASH_DEDICATED
#include "common.h"
#include "xash3d_mathlib.h"
@ -205,12 +205,12 @@ void Host_InputFrame( void )
void VID_InitDefaultResolution( void )
{
}
void Con_Init( void )
{
}
void R_ClearAllDecals( void )

View File

@ -1058,7 +1058,7 @@ static qboolean FS_AddPak_Fullpath( const char *pakfile, qboolean *already_loade
pack_t *pak = NULL;
const char *ext = COM_FileExtension( pakfile );
int i, errorcode = PAK_LOAD_COULDNT_OPEN;
for( search = fs_searchpaths; search; search = search->next )
{
if( search->pack && !Q_stricmp( search->pack->filename, pakfile ))
@ -1112,7 +1112,7 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
zip_t *zip = NULL;
const char *ext = COM_FileExtension( zipfile );
int errorcode = ZIP_LOAD_COULDNT_OPEN;
for( search = fs_searchpaths; search; search = search->next )
{
if( search->pack && !Q_stricmp( search->pack->filename, zipfile ))
@ -1121,12 +1121,12 @@ qboolean FS_AddZip_Fullpath( const char *zipfile, qboolean *already_loaded, int
return true; // already loaded
}
}
if( already_loaded ) *already_loaded = false;
if( !Q_stricmp( ext, "pk3" ) )
zip = FS_LoadZip( zipfile, &errorcode );
if( zip )
{
string fullpath;
@ -1300,7 +1300,7 @@ void FS_ClearSearchPath( void )
if( search->pack )
{
if( search->pack->files )
if( search->pack->files )
Mem_Free( search->pack->files );
if( search->pack->handle >= 0 )
close( search->pack->handle );
@ -1467,7 +1467,7 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
FS_Printf( f, "date\t\t\"%s\"\n", GameInfo->date );
if( COM_CheckStringEmpty( GameInfo->dll_path ) )
FS_Printf( f, "dllpath\t\t\"%s\"\n", GameInfo->dll_path );
FS_Printf( f, "dllpath\t\t\"%s\"\n", GameInfo->dll_path );
if( COM_CheckStringEmpty( GameInfo->game_dll ) )
FS_Printf( f, "gamedll\t\t\"%s\"\n", GameInfo->game_dll );
@ -1803,7 +1803,7 @@ static qboolean FS_ParseLiblistGam( const char *filename, const char *gamedir, g
{
char *afile;
if( !GameInfo ) return false;
if( !GameInfo ) return false;
afile = (char *)FS_LoadFile( filename, NULL, false );
if( !afile ) return false;
@ -2002,7 +2002,7 @@ void FS_LoadGameInfo( const char *rootfolder )
{
SI.clientlib[0] = 0;
}
FS_Rescan(); // create new filesystem
Image_CheckPaletteQ1 ();
@ -2020,7 +2020,7 @@ void FS_Init( void )
qboolean hasBaseDir = false;
qboolean hasGameDir = false;
int i;
FS_InitMemory();
Cmd_AddCommand( "fs_rescan", FS_Rescan_f, "rescan filesystem search pathes" );
@ -2051,7 +2051,7 @@ void FS_Init( void )
SI.numgames = 0;
Q_strncpy( fs_basedir, SI.basedirName, sizeof( fs_basedir )); // default dir
if( !Sys_GetParmFromCmdLine( "-game", fs_gamedir ))
Q_strncpy( fs_gamedir, fs_basedir, sizeof( fs_gamedir )); // gamedir == basedir
@ -2157,7 +2157,7 @@ Internal function used to determine filetime
static int FS_SysFileTime( const char *filename )
{
struct stat buf;
if( stat( filename, &buf ) == -1 )
return -1;
@ -2457,7 +2457,7 @@ static searchpath_t *FS_FindFile( const char *name, int *index, qboolean gamedir
}
else if( search->wad )
{
dlumpinfo_t *lump;
dlumpinfo_t *lump;
signed char type = W_TypeFromExt( name );
qboolean anywadname = true;
string wadname, wadfolder;
@ -2588,7 +2588,7 @@ file_t *FS_OpenReadFile( const char *filename, const char *mode, qboolean gamedi
// not found?
if( search == NULL )
return NULL;
return NULL;
if( search->pack )
return FS_OpenPackedFile( search->pack, pack_ind );
@ -2603,7 +2603,7 @@ file_t *FS_OpenReadFile( const char *filename, const char *mode, qboolean gamedi
// found in the filesystem?
Q_sprintf( path, "%s%s", search->filename, filename );
return FS_SysOpen( path, mode );
}
}
return NULL;
}
@ -2644,7 +2644,7 @@ file_t *FS_Open( const char *filepath, const char *mode, qboolean gamedironly )
FS_CreatePath( real_path );// Create directories up to the file
return FS_SysOpen( real_path, mode );
}
// else, we look at the various search paths and open the file in read-only mode
return FS_OpenReadFile( filepath, mode, gamedironly );
}
@ -2939,10 +2939,10 @@ int FS_Seek( file_t *file, fs_offset_t offset, int whence )
case SEEK_END:
offset += file->real_length;
break;
default:
default:
return -1;
}
if( offset < 0 || offset > file->real_length )
return -1;
@ -3286,7 +3286,7 @@ dll_user_t *FS_FindLibrary( const char *dllname, qboolean directpath )
// NOTE: for libraries we not fail even if search is NULL
// let the OS find library himself
hInst = Mem_Calloc( host.mempool, sizeof( dll_user_t ));
hInst = Mem_Calloc( host.mempool, sizeof( dll_user_t ));
// save dllname for debug purposes
Q_strncpy( hInst->dllName, dllname, sizeof( hInst->dllName ));
@ -3308,7 +3308,7 @@ dll_user_t *FS_FindLibrary( const char *dllname, qboolean directpath )
hInst->custom_loader = (search) ? true : false;
}
fs_ext_path = false; // always reset direct paths
return hInst;
}
@ -3322,7 +3322,7 @@ return size of file in bytes
fs_offset_t FS_FileSize( const char *filename, qboolean gamedironly )
{
int length = -1; // in case file was missed
file_t *fp;
file_t *fp;
fp = FS_Open( filename, "rb", gamedironly );
@ -3361,7 +3361,7 @@ int FS_FileTime( const char *filename, qboolean gamedironly )
{
searchpath_t *search;
int pack_ind;
search = FS_FindFile( filename, &pack_ind, gamedironly );
if( !search ) return -1; // doesn't exist
@ -3684,7 +3684,7 @@ search_t *FS_Search( const char *pattern, int caseinsensitive, int gamedironly )
void FS_InitMemory( void )
{
fs_mempool = Mem_AllocPool( "FileSystem Pool" );
fs_mempool = Mem_AllocPool( "FileSystem Pool" );
fs_searchpaths = NULL;
}
@ -3722,7 +3722,7 @@ static signed char W_TypeFromExt( const char *lumpname )
// we not known about filetype, so match only by filename
if( !Q_strcmp( ext, "*" ) || !Q_strcmp( ext, "" ))
return TYP_ANY;
for( type = wad_types; type->ext; type++ )
{
if( !Q_stricmp( ext, type->ext ))
@ -3771,7 +3771,7 @@ static dlumpinfo_t *W_FindLump( wfile_t *wad, const char *name, const signed cha
// look for the file (binary search)
left = 0;
right = wad->numlumps - 1;
while( left <= right )
{
int middle = (left + right) / 2;
@ -3921,7 +3921,7 @@ wfile_t *W_Open( const char *filename, int *error )
wad->handle = FS_SysOpen( filename, "rb" );
if( wad->handle == NULL )
{
{
Con_Reportf( S_ERROR "W_Open: couldn't open %s\n", filename );
if( error ) *error = WAD_LOAD_COULDNT_OPEN;
W_Close( wad );
@ -4008,7 +4008,7 @@ wfile_t *W_Open( const char *filename, int *error )
// check for Quake 'conchars' issues (only lmp loader really allows to read this lame pic)
if( srclumps[i].type == 68 && !Q_stricmp( srclumps[i].name, "conchars" ))
srclumps[i].type = TYP_GFXPIC;
srclumps[i].type = TYP_GFXPIC;
W_AddFileToWad( name, wad, &srclumps[i] );
}
@ -4033,7 +4033,7 @@ void W_Close( wfile_t *wad )
Mem_FreePool( &wad->mempool );
if( wad->handle != NULL )
FS_Close( wad->handle );
FS_Close( wad->handle );
Mem_Free( wad ); // free himself
}
@ -4058,6 +4058,6 @@ static byte *W_LoadFile( const char *path, fs_offset_t *lumpsizeptr, qboolean ga
search = FS_FindFile( path, &index, gamedironly );
if( search && search->wad )
return W_ReadLump( search->wad, &search->wad->lumps[index], lumpsizeptr );
return W_ReadLump( search->wad, &search->wad->lumps[index], lumpsizeptr );
return NULL;
}

View File

@ -39,7 +39,7 @@ void BuildGammaTable( float lightgamma, float brightness )
else g3 = 0.125f - (brightness * brightness) * 0.075f;
g = 1.0f / lightgamma;
g1 = GAMMA * g;
g1 = GAMMA * g;
for( i = 0; i < 256; i++ )
{

View File

@ -225,21 +225,21 @@ void Host_EndGame( qboolean abort, const char *message, ... )
{
va_list argptr;
static char string[MAX_SYSPATH];
va_start( argptr, message );
Q_vsnprintf( string, sizeof( string ), message, argptr );
va_end( argptr );
Con_Printf( "Host_EndGame: %s\n", string );
SV_Shutdown( "\n" );
SV_Shutdown( "\n" );
#if !XASH_DEDICATED
CL_Disconnect();
// recreate world if needs
CL_ClearEdicts ();
#endif
// release all models
Mod_FreeAll();
@ -331,7 +331,7 @@ void Host_ChangeGame_f( void )
}
else if( !Q_stricmp( GI->gamefolder, Cmd_Argv( 1 )))
{
Con_Printf( "%s already active\n", Cmd_Argv( 1 ));
Con_Printf( "%s already active\n", Cmd_Argv( 1 ));
}
else
{
@ -367,7 +367,7 @@ void Host_Exec_f( void )
return;
}
Q_strncpy( cfgpath, Cmd_Argv( 1 ), sizeof( cfgpath ));
Q_strncpy( cfgpath, Cmd_Argv( 1 ), sizeof( cfgpath ));
COM_DefaultExtension( cfgpath, ".cfg" ); // append as default
f = FS_LoadFile( cfgpath, &len, false );
@ -606,7 +606,7 @@ qboolean Host_FilterTime( float time )
else
{
if(( host.realtime - oldtime ) < ( 1.0 / fps ))
return false;
return false;
}
}
@ -696,7 +696,7 @@ void GAME_EXPORT Host_Error( const char *error, ... )
if( host.status == HOST_SHUTDOWN ) return;
if( recursive )
{
{
Con_Printf( "Host_RecursiveError: %s", hosterror2 );
Sys_Error( "%s", hosterror1 );
return; // don't multiple executes
@ -1013,7 +1013,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
host_serverstate = Cvar_Get( "host_serverstate", "0", FCVAR_READ_ONLY, "displays current server state" );
host_maxfps = Cvar_Get( "fps_max", "72", FCVAR_ARCHIVE, "host fps upper limit" );
host_framerate = Cvar_Get( "host_framerate", "0", 0, "locks frame timing to this value in seconds" );
host_framerate = Cvar_Get( "host_framerate", "0", 0, "locks frame timing to this value in seconds" );
host_sleeptime = Cvar_Get( "sleeptime", "1", FCVAR_ARCHIVE, "milliseconds to sleep for each frame. higher values reduce fps accuracy" );
host_gameloaded = Cvar_Get( "host_gameloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded game.dll" );
host_clientloaded = Cvar_Get( "host_clientloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded client.dll" );
@ -1074,7 +1074,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
Cbuf_AddText( "exec config.cfg\n" );
Cbuf_Execute();
}
// exec all files from userconfig.d
// exec all files from userconfig.d
Host_Userconfigd_f();
break;
case HOST_DEDICATED:

View File

@ -44,7 +44,7 @@ const char *HPAK_TypeFromIndex( int type )
case t_decal: return "decal";
case t_generic: return "generic";
case t_eventscript: return "event";
case t_world: return "map";
case t_world: return "map";
}
return "?";
}
@ -439,7 +439,7 @@ static qboolean HPAK_Validate( const char *filename, qboolean quiet )
pRes = &dataDir[i].resource;
Con_Printf( "%i: %s %s %s: ", i, HPAK_TypeFromIndex( pRes->type ),
Q_pretifymem( pRes->nDownloadSize, 2 ), pRes->szFileName );
Q_pretifymem( pRes->nDownloadSize, 2 ), pRes->szFileName );
if( memcmp( md5, pRes->rgucMD5_hash, 0x10 ))
{
@ -518,7 +518,7 @@ qboolean HPAK_ResourceForHash( const char *filename, byte *hash, resource_t *pRe
if( !COM_CheckString( filename ))
return false;
for( p = gp_hpak_queue; p != NULL; p = p->next )
{
if( !Q_stricmp( p->name, filename ) && !memcmp( p->resource.rgucMD5_hash, hash, 16 ))

View File

@ -366,7 +366,7 @@ int ID_GetKeyData( HKEY hRootKey, char *subKey, char *value, LPBYTE data, DWORD
if( RegOpenKeyEx( hRootKey, subKey, 0, KEY_QUERY_VALUE, &hKey ) != ERROR_SUCCESS )
return 0;
if( RegQueryValueEx( hKey, value, NULL, NULL, data, &cbData ) != ERROR_SUCCESS )
{
RegCloseKey( hKey );
@ -381,13 +381,13 @@ int ID_SetKeyData( HKEY hRootKey, char *subKey, DWORD dwType, char *value, LPBYT
HKEY hKey;
if( RegCreateKey( hRootKey, subKey, &hKey ) != ERROR_SUCCESS )
return 0;
if( RegSetValueEx( hKey, value, 0, dwType, data, cbData ) != ERROR_SUCCESS )
{
RegCloseKey( hKey );
return 0;
}
RegCloseKey( hKey );
return 1;
}
@ -403,18 +403,18 @@ int ID_RunWMIC(char *buffer, const char *cmdline)
DWORD dwRead;
BOOL bSuccess = FALSE;
SECURITY_ATTRIBUTES saAttr;
STARTUPINFO si = {0};
PROCESS_INFORMATION pi = {0};
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
CreatePipe( &g_IN_Rd, &g_IN_Wr, &saAttr, 0 );
CreatePipe( &g_OUT_Rd, &g_OUT_Wr, &saAttr, 0 );
SetHandleInformation( g_IN_Wr, HANDLE_FLAG_INHERIT, 0 );
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdInput = g_IN_Rd;
@ -424,12 +424,12 @@ int ID_RunWMIC(char *buffer, const char *cmdline)
si.dwFlags |= STARTF_USESTDHANDLES;
CreateProcess( NULL, (char*)cmdline, NULL, NULL, true, CREATE_NO_WINDOW , NULL, NULL, &si, &pi );
CloseHandle( g_OUT_Wr );
CloseHandle( g_IN_Wr );
WaitForSingleObject( pi.hProcess, 500 );
bSuccess = ReadFile( g_OUT_Rd, buffer, BUFSIZE, &dwRead, NULL );
buffer[BUFSIZE-1] = 0;
CloseHandle( g_IN_Rd );
@ -541,7 +541,7 @@ uint ID_CheckRawId( bloomfilter_t filter )
if( ID_ProcessCPUInfo( &value ) )
count += (filter & value) == value;
#endif
#if XASH_WIN32
count += ID_CheckWMIC( filter, "wmic path win32_physicalmedia get SerialNumber" );
count += ID_CheckWMIC( filter, "wmic bios get serialnumber" );
@ -627,12 +627,12 @@ void ID_Init( void )
id ^= SYSTEM_XOR_MASK;
ID_Check();
}
#elif XASH_WIN32
{
CHAR szBuf[MAX_PATH];
ID_GetKeyData( HKEY_CURRENT_USER, "Software\\Xash3D\\", "xash_id", szBuf, MAX_PATH );
sscanf(szBuf, "%016llX", &id);
id ^= SYSTEM_XOR_MASK;
ID_Check();

View File

@ -80,7 +80,7 @@ typedef struct imglib_s
int source_width; // locked cubemap dims (all wrong sides will be automatically resampled)
int source_height;
uint source_type; // shared image type for all mipmaps or cubemap sides
int num_sides; // how much sides is loaded
int num_sides; // how much sides is loaded
byte *cubemap; // cubemap pack
// indexed images state

View File

@ -51,7 +51,7 @@ qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesi
{
Con_DPrintf( S_ERROR "Image_LoadBMP: only Windows-style BMP files supported (%s)\n", name );
return false;
}
}
if( bhdr.bitmapHeaderSize != 0x28 )
{
@ -67,7 +67,7 @@ qboolean Image_LoadBMP( const char *name, const byte *buffer, fs_offset_t filesi
}
// bogus compression? Only non-compressed supported.
if( bhdr.compression != BI_RGB )
if( bhdr.compression != BI_RGB )
{
Con_DPrintf( S_ERROR "Image_LoadBMP: only uncompressed BMP files supported (%s)\n", name );
return false;
@ -352,7 +352,7 @@ qboolean Image_SaveBMP( const char *name, rgbdata_t *pix )
break;
case PF_RGBA_32:
pixel_size = 4;
break;
break;
default:
return false;
}
@ -361,7 +361,7 @@ qboolean Image_SaveBMP( const char *name, rgbdata_t *pix )
if( !pfile ) return false;
// NOTE: align transparency column will sucessfully removed
// after create sprite or lump image, it's just standard requiriments
// after create sprite or lump image, it's just standard requiriments
biTrueWidth = ((pix->width + 3) & ~3);
cbBmpBits = biTrueWidth * pix->height * pixel_size;
cbPalBytes = ( pixel_size == 1 ) ? 256 * sizeof( rgba_t ) : 0;

View File

@ -20,8 +20,8 @@ GNU General Public License for more details.
qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin )
{
word sAlpha;
byte *alpha;
int x, y, i, j;
byte *alpha;
int x, y, i, j;
for( y = 0; y < hdr->dwHeight; y += 4 )
{
@ -53,8 +53,8 @@ qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin )
qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin )
{
uint bits, bitmask;
byte *alphamask;
int x, y, i, j;
byte *alphamask;
int x, y, i, j;
for( y = 0; y < hdr->dwHeight; y += 4 )
{
@ -90,7 +90,7 @@ qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin )
return false;
}
void Image_DXTGetPixelFormat( dds_t *hdr )
{
uint bits = hdr->dsPixelFormat.dwRGBBitCount;
@ -102,7 +102,7 @@ void Image_DXTGetPixelFormat( dds_t *hdr )
{
switch( hdr->dsPixelFormat.dwFourCC )
{
case TYPE_DXT1:
case TYPE_DXT1:
image.type = PF_DXT1;
break;
case TYPE_DXT2:
@ -136,7 +136,7 @@ void Image_DXTGetPixelFormat( dds_t *hdr )
{
image.type = PF_UNKNOWN; // assume error
}
else
else
{
switch( bits )
{
@ -177,16 +177,16 @@ size_t Image_DXTGetLinearSize( int type, int width, int height, int depth )
case PF_RGB_24: return (width * height * depth * 3);
case PF_BGRA_32:
case PF_RGBA_32: return (width * height * depth * 4);
}
}
return 0;
}
size_t Image_DXTCalcMipmapSize( dds_t *hdr )
size_t Image_DXTCalcMipmapSize( dds_t *hdr )
{
size_t buffsize = 0;
int i, width, height;
// now correct buffer size
for( i = 0; i < Q_max( 1, ( hdr->dwMipMapCount )); i++ )
{
@ -198,14 +198,14 @@ size_t Image_DXTCalcMipmapSize( dds_t *hdr )
return buffsize;
}
uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
{
size_t buffsize = 0;
int w = image.width;
int h = image.height;
int d = image.depth;
if( hdr->dsCaps.dwCaps2 & DDS_CUBEMAP )
if( hdr->dsCaps.dwCaps2 & DDS_CUBEMAP )
{
// cubemap w*h always match for all sides
buffsize = Image_DXTCalcMipmapSize( hdr ) * 6;
@ -220,7 +220,7 @@ uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
// just in case (no need, really)
buffsize = hdr->dwLinearSize;
}
else
else
{
// pretty solution for microsoft bug
buffsize = Image_DXTCalcMipmapSize( hdr );
@ -290,13 +290,13 @@ qboolean Image_LoadDDS( const char *name, const byte *buffer, fs_offset_t filesi
if( !Image_CheckFlag( IL_DDS_HARDWARE ) && ImageDXT( image.type ))
return false; // silently rejected
if( image.type == PF_UNKNOWN )
if( image.type == PF_UNKNOWN )
{
Con_DPrintf( S_ERROR "Image_LoadDDS: (%s) has unrecognized type\n", name );
return false;
}
image.size = Image_DXTCalcSize( name, &header, filesize - 128 );
image.size = Image_DXTCalcSize( name, &header, filesize - 128 );
if( image.size == 0 ) return false; // just in case
fin = (byte *)(buffer + sizeof( dds_t ));
@ -338,7 +338,7 @@ qboolean Image_LoadDDS( const char *name, const byte *buffer, fs_offset_t filesi
}
// dds files will be uncompressed on a render. requires minimal of info for set this
image.rgba = Mem_Malloc( host.imagepool, image.size );
image.rgba = Mem_Malloc( host.imagepool, image.size );
memcpy( image.rgba, fin, image.size );
SetBits( image.flags, IMAGE_DDS_FORMAT );

View File

@ -69,7 +69,7 @@ static const cubepack_t load_cubemap[] =
{ NULL, NULL },
};
// soul of ImageLib - table of image format constants
// soul of ImageLib - table of image format constants
const bpc_desc_t PFDesc[] =
{
{ PF_UNKNOWN, "raw", 0x1908, 0 },
@ -123,7 +123,7 @@ rgbdata_t *ImagePack( void )
return NULL;
}
if( image.cubemap )
if( image.cubemap )
{
image.flags |= IMAGE_CUBEMAP;
pack->buffer = image.cubemap;
@ -132,7 +132,7 @@ rgbdata_t *ImagePack( void )
pack->type = image.source_type;
pack->size = image.size * image.num_sides;
}
else
else
{
pack->buffer = image.rgba;
pack->width = image.width;
@ -152,7 +152,7 @@ rgbdata_t *ImagePack( void )
pack->numMips = image.num_mips;
pack->palette = image.palette;
pack->encode = image.encode;
return pack;
}
@ -166,7 +166,7 @@ qboolean FS_AddSideToPack( const char *name, int adjust_flags )
{
byte *out, *flipped;
qboolean resampled = false;
// first side set average size for all cubemap sides!
if( !image.cubemap )
{
@ -258,7 +258,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
Mem_Free( f ); // release buffer
return ImagePack(); // loaded
}
else Mem_Free( f ); // release buffer
else Mem_Free( f ); // release buffer
}
}
}
@ -280,7 +280,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
f = FS_LoadFile( path, &filesize, false );
if( f && filesize > 0 )
{
// this name will be used only for tell user about problems
// this name will be used only for tell user about problems
if( format->loadfunc( path, f, filesize ))
{
Q_snprintf( sidename, sizeof( sidename ), "%s%s.%s", loadname, cmap->type[i].suf, format->ext );
@ -298,7 +298,7 @@ rgbdata_t *FS_LoadImage( const char *filename, const byte *buffer, size_t size )
if( image.num_sides != i + 1 ) // check side
{
// first side not found, probably it's not cubemap
// it contain info about image_type and dimensions, don't generate black cubemaps
// it contain info about image_type and dimensions, don't generate black cubemaps
if( !image.cubemap ) break;
// Mem_Alloc already filled memblock with 0x00, no need to do it again
image.cubemap = Mem_Realloc( host.imagepool, image.cubemap, image.ptr + image.size );
@ -386,7 +386,7 @@ qboolean FS_SaveImage( const char *filename, rgbdata_t *pix )
return false; // do not happens
}
pix->size /= 6; // now set as side size
pix->size /= 6; // now set as side size
picBuffer = pix->buffer;
// save all sides seperately

View File

@ -42,7 +42,7 @@ GNU General Public License for more details.
#define radiusbiasshift 6 // at 32.0 biased by 6 bits
#define radiusbias (1<<radiusbiasshift)
#define initradius (initrad * radiusbias) // and decreases by a
#define radiusdec 30 // factor of 1/30 each cycle
#define radiusdec 30 // factor of 1/30 each cycle
// defs for decreasing alpha factor
#define alphabiasshift 10 // alpha starts at 1.0
@ -65,14 +65,14 @@ static int bias[netsize]; // bias and freq arrays for learning
static int freq[netsize];
static int radpower[initrad]; // radpower for precomputation
void initnet( byte *thepic, int len, int sample )
void initnet( byte *thepic, int len, int sample )
{
register int i, *p;
thepicture = thepic;
lengthcount = len;
samplefac = sample;
for( i = 0; i < netsize; i++ )
{
p = network[i];
@ -81,7 +81,7 @@ void initnet( byte *thepic, int len, int sample )
bias[i] = 0;
}
}
// Unbias network to give byte values 0..255 and record position i to prepare for sort
void unbiasnet( void )
{
@ -369,12 +369,12 @@ void learn( void )
delta = samplepixels / ncycles;
alpha = initalpha;
radius = initradius;
rad = radius >> radiusbiasshift;
if( rad <= 1 ) rad = 0;
for( i = 0; i < rad; i++ )
radpower[i] = alpha * ((( rad * rad - i * i ) * radbias ) / ( rad * rad ));
for( i = 0; i < rad; i++ )
radpower[i] = alpha * ((( rad * rad - i * i ) * radbias ) / ( rad * rad ));
if( delta <= 0 ) return;
@ -394,7 +394,7 @@ void learn( void )
{
step = prime4 * image.bpp;
}
i = 0;
while( i < samplepixels )
@ -409,17 +409,17 @@ void learn( void )
p += step;
if( p >= lim ) p -= lengthcount;
i++;
if( i % delta == 0 )
{
{
alpha -= alpha / alphadec;
radius -= radius / radiusdec;
rad = radius >> radiusbiasshift;
if( rad <= 1 ) rad = 0;
for( j = 0; j < rad; j++ )
for( j = 0; j < rad; j++ )
radpower[j] = alpha * ((( rad * rad - j * j ) * radbias ) / ( rad * rad ));
}
}
@ -452,7 +452,7 @@ rgbdata_t *Image_Quantize( rgbdata_t *pic )
{
pic->palette[i*3+0] = network[i][0]; // red
pic->palette[i*3+1] = network[i][1]; // green
pic->palette[i*3+2] = network[i][2]; // blue
pic->palette[i*3+2] = network[i][2]; // blue
}
inxbuild();

View File

@ -326,7 +326,7 @@ qboolean Image_SaveTGA( const char *name, rgbdata_t *pix )
}
}
break;
}
}
FS_WriteFile( name, buffer, outsize );

View File

@ -80,14 +80,14 @@ static byte palette_hl[768] =
147,255,247,199,255,255,255,159,91,83
};
static float img_emboss[FILTER_SIZE][FILTER_SIZE] =
static float img_emboss[FILTER_SIZE][FILTER_SIZE] =
{
{-0.7f, -0.7f, -0.7f, -0.7f, 0.0f },
{-0.7f, -0.7f, -0.7f, 0.0f, 0.7f },
{-0.7f, -0.7f, 0.0f, 0.7f, 0.7f },
{-0.7f, 0.0f, 0.7f, 0.7f, 0.7f },
{ 0.0f, 0.7f, 0.7f, 0.7f, 0.7f },
};
{-0.7f, -0.7f, -0.7f, -0.7f, 0.0f },
{-0.7f, -0.7f, -0.7f, 0.0f, 0.7f },
{-0.7f, -0.7f, 0.0f, 0.7f, 0.7f },
{-0.7f, 0.0f, 0.7f, 0.7f, 0.7f },
{ 0.0f, 0.7f, 0.7f, 0.7f, 0.7f },
};
/*
=============================================================================
@ -148,7 +148,7 @@ void Image_Init( void )
switch( host.type )
{
case HOST_NORMAL:
image.cmd_flags = IL_USE_LERPING|IL_ALLOW_OVERWRITE;
image.cmd_flags = IL_USE_LERPING|IL_ALLOW_OVERWRITE;
image.loadformats = load_game;
image.saveformats = save_game;
break;
@ -180,7 +180,7 @@ byte *Image_Copy( size_t size )
out = Mem_Malloc( host.imagepool, size );
memcpy( out, image.tempbuffer, size );
return out;
return out;
}
/*
@ -272,13 +272,13 @@ int Image_ComparePalette( const byte *pal )
return PAL_QUAKE1;
else if( !memcmp( palette_hl, pal, 765 ))
return PAL_HALFLIFE;
return PAL_CUSTOM;
return PAL_CUSTOM;
}
void Image_SetPalette( const byte *pal, uint *d_table )
{
byte rgba[4];
int i;
int i;
// setup palette
switch( image.d_rendermode )
@ -323,7 +323,7 @@ void Image_SetPalette( const byte *pal, uint *d_table )
rgba[3] = pal[i*4+3];
d_table[i] = *(uint *)rgba;
}
break;
break;
}
}
@ -459,12 +459,12 @@ void Image_PaletteHueReplace( byte *palSrc, int newHue, int start, int end, int
r = palSrc[i*pal_size+0];
g = palSrc[i*pal_size+1];
b = palSrc[i*pal_size+2];
maxcol = max( max( r, g ), b ) / 255.0f;
mincol = min( min( r, g ), b ) / 255.0f;
if( maxcol == 0 ) continue;
val = maxcol;
sat = (maxcol - mincol) / maxcol;
@ -871,7 +871,7 @@ void Image_Resample24Lerp( const void *indata, int inwidth, int inheight, void *
byte *out = (byte *)outdata;
byte *resamplerow1;
byte *resamplerow2;
fstep = (int)(inheight * 65536.0f / outheight);
resamplerow1 = (byte *)Mem_Malloc( host.imagepool, outwidth * 3 * 2 );
@ -1075,7 +1075,7 @@ byte *Image_ResampleInternal( const void *indata, int inwidth, int inheight, int
case PF_INDEXED_32:
image.tempbuffer = (byte *)Mem_Realloc( host.imagepool, image.tempbuffer, outwidth * outheight );
Image_Resample8Nolerp( indata, inwidth, inheight, image.tempbuffer, outwidth, outheight );
break;
break;
case PF_RGB_24:
case PF_BGR_24:
image.tempbuffer = (byte *)Mem_Realloc( host.imagepool, image.tempbuffer, outwidth * outheight * 3 );
@ -1090,7 +1090,7 @@ byte *Image_ResampleInternal( const void *indata, int inwidth, int inheight, int
break;
default:
*resampled = false;
return (byte *)indata;
return (byte *)indata;
}
*resampled = true;
@ -1106,7 +1106,7 @@ byte *Image_FlipInternal( const byte *in, word *srcwidth, word *srcheight, int t
{
int i, x, y;
word width = *srcwidth;
word height = *srcheight;
word height = *srcheight;
int samples = PFDesc[type].bpp;
qboolean flip_x = FBitSet( flags, IMAGE_FLIP_X ) ? true : false;
qboolean flip_y = FBitSet( flags, IMAGE_FLIP_Y ) ? true : false;
@ -1133,7 +1133,7 @@ byte *Image_FlipInternal( const byte *in, word *srcwidth, word *srcheight, int t
image.tempbuffer = Mem_Realloc( host.imagepool, image.tempbuffer, width * height * samples );
break;
default:
return (byte *)in;
return (byte *)in;
}
out = image.tempbuffer;
@ -1157,12 +1157,12 @@ byte *Image_FlipInternal( const byte *in, word *srcwidth, word *srcheight, int t
if( FBitSet( flags, IMAGE_ROT_90 ))
{
*srcwidth = height;
*srcheight = width;
*srcheight = width;
}
else
{
*srcwidth = width;
*srcheight = height;
*srcheight = height;
}
return image.tempbuffer;
@ -1174,7 +1174,7 @@ byte *Image_CreateLumaInternal( byte *fin, int width, int height, int type, int
int i;
if( !FBitSet( flags, IMAGE_HAS_LUMA ))
return (byte *)fin;
return (byte *)fin;
switch( type )
{
@ -1187,7 +1187,7 @@ byte *Image_CreateLumaInternal( byte *fin, int width, int height, int type, int
default:
// another formats does ugly result :(
Con_Printf( S_ERROR "Image_MakeLuma: unsupported format %s\n", PFDesc[type].name );
return (byte *)fin;
return (byte *)fin;
}
return image.tempbuffer;
@ -1206,10 +1206,10 @@ qboolean Image_AddIndexedImageToPack( const byte *in, int width, int height )
image.size = mipsize;
if( expand_to_rgba ) image.size *= 4;
else Image_CopyPalette32bit();
else Image_CopyPalette32bit();
// reallocate image buffer
image.rgba = Mem_Malloc( host.imagepool, image.size );
image.rgba = Mem_Malloc( host.imagepool, image.size );
if( !expand_to_rgba ) memcpy( image.rgba, in, image.size );
else if( !Image_Copy8bitRGBA( in, image.rgba, mipsize ))
return false; // probably pallette not installed
@ -1227,7 +1227,7 @@ force to unpack any image to 32-bit buffer
qboolean Image_Decompress( const byte *data )
{
byte *fin, *fout;
int i, size;
int i, size;
if( !data ) return false;
fin = (byte *)data;
@ -1242,8 +1242,8 @@ qboolean Image_Decompress( const byte *data )
if( image.flags & IMAGE_HAS_ALPHA )
{
if( image.flags & IMAGE_COLORINDEX )
Image_GetPaletteLMP( image.palette, LUMP_GRADIENT );
else Image_GetPaletteLMP( image.palette, LUMP_MASKED );
Image_GetPaletteLMP( image.palette, LUMP_GRADIENT );
else Image_GetPaletteLMP( image.palette, LUMP_MASKED );
}
else Image_GetPaletteLMP( image.palette, LUMP_NORMAL );
// intentionally fallthrough
@ -1363,22 +1363,22 @@ qboolean Image_RemapInternal( rgbdata_t *pic, int topColor, int bottomColor )
return true;
}
/*
==================
/*
==================
Image_ApplyFilter
Applies a 5 x 5 filtering matrix to the texture, then runs it through a simulated OpenGL texture environment
blend with the original data to derive a new texture. Freaky, funky, and *f--king* *fantastic*. You can do
reasonable enough "fake bumpmapping" with this baby...
Applies a 5 x 5 filtering matrix to the texture, then runs it through a simulated OpenGL texture environment
blend with the original data to derive a new texture. Freaky, funky, and *f--king* *fantastic*. You can do
reasonable enough "fake bumpmapping" with this baby...
Filtering algorithm from http://www.student.kuleuven.ac.be/~m0216922/CG/filtering.html
All credit due
==================
Filtering algorithm from http://www.student.kuleuven.ac.be/~m0216922/CG/filtering.html
All credit due
==================
*/
static void Image_ApplyFilter( rgbdata_t *pic, float factor )
{
int i, x, y;
uint *fin, *fout;
{
int i, x, y;
uint *fin, *fout;
size_t size;
// don't waste time
@ -1392,72 +1392,72 @@ static void Image_ApplyFilter( rgbdata_t *pic, float factor )
fout = (uint *)image.tempbuffer;
fin = (uint *)pic->buffer;
for( x = 0; x < image.width; x++ )
{
for( y = 0; y < image.height; y++ )
{
vec3_t vout = { 0.0f, 0.0f, 0.0f };
for( x = 0; x < image.width; x++ )
{
for( y = 0; y < image.height; y++ )
{
vec3_t vout = { 0.0f, 0.0f, 0.0f };
int pos_x, pos_y;
float avg;
for( pos_x = 0; pos_x < FILTER_SIZE; pos_x++ )
{
for( pos_y = 0; pos_y < FILTER_SIZE; pos_y++ )
{
int img_x = (x - (FILTER_SIZE / 2) + pos_x + image.width) % image.width;
int img_y = (y - (FILTER_SIZE / 2) + pos_y + image.height) % image.height;
for( pos_x = 0; pos_x < FILTER_SIZE; pos_x++ )
{
for( pos_y = 0; pos_y < FILTER_SIZE; pos_y++ )
{
int img_x = (x - (FILTER_SIZE / 2) + pos_x + image.width) % image.width;
int img_y = (y - (FILTER_SIZE / 2) + pos_y + image.height) % image.height;
// casting's a unary operation anyway, so the othermost set of brackets in the left part
// of the rvalue should not be necessary... but i'm paranoid when it comes to C...
vout[0] += ((float)((byte *)&fin[img_y * image.width + img_x])[0]) * img_emboss[pos_x][pos_y];
vout[1] += ((float)((byte *)&fin[img_y * image.width + img_x])[1]) * img_emboss[pos_x][pos_y];
vout[2] += ((float)((byte *)&fin[img_y * image.width + img_x])[2]) * img_emboss[pos_x][pos_y];
}
}
// casting's a unary operation anyway, so the othermost set of brackets in the left part
// of the rvalue should not be necessary... but i'm paranoid when it comes to C...
vout[0] += ((float)((byte *)&fin[img_y * image.width + img_x])[0]) * img_emboss[pos_x][pos_y];
vout[1] += ((float)((byte *)&fin[img_y * image.width + img_x])[1]) * img_emboss[pos_x][pos_y];
vout[2] += ((float)((byte *)&fin[img_y * image.width + img_x])[2]) * img_emboss[pos_x][pos_y];
}
}
// multiply by factor, add bias, and clamp
for( i = 0; i < 3; i++ )
{
vout[i] *= factor;
vout[i] += 128.0f; // base
// multiply by factor, add bias, and clamp
for( i = 0; i < 3; i++ )
{
vout[i] *= factor;
vout[i] += 128.0f; // base
vout[i] = bound( 0.0f, vout[i], 255.0f );
}
}
// NTSC greyscale conversion standard
avg = (vout[0] * 30.0f + vout[1] * 59.0f + vout[2] * 11.0f) / 100.0f;
// NTSC greyscale conversion standard
avg = (vout[0] * 30.0f + vout[1] * 59.0f + vout[2] * 11.0f) / 100.0f;
// divide by 255 so GL operations work as expected
vout[0] = avg / 255.0f;
vout[1] = avg / 255.0f;
vout[2] = avg / 255.0f;
// divide by 255 so GL operations work as expected
vout[0] = avg / 255.0f;
vout[1] = avg / 255.0f;
vout[2] = avg / 255.0f;
// write to temp - first, write data in (to get the alpha channel quickly and
// easily, which will be left well alone by this particular operation...!)
fout[y * image.width + x] = fin[y * image.width + x];
// write to temp - first, write data in (to get the alpha channel quickly and
// easily, which will be left well alone by this particular operation...!)
fout[y * image.width + x] = fin[y * image.width + x];
// now write in each element, applying the blend operator. blend
// operators are based on standard OpenGL TexEnv modes, and the
// formulas are derived from the OpenGL specs (http://www.opengl.org).
for( i = 0; i < 3; i++ )
{
// divide by 255 so GL operations work as expected
float src = ((float)((byte *)&fin[y * image.width + x])[i]) / 255.0f;
// now write in each element, applying the blend operator. blend
// operators are based on standard OpenGL TexEnv modes, and the
// formulas are derived from the OpenGL specs (http://www.opengl.org).
for( i = 0; i < 3; i++ )
{
// divide by 255 so GL operations work as expected
float src = ((float)((byte *)&fin[y * image.width + x])[i]) / 255.0f;
float tmp;
// default is GL_BLEND here
// CsS + CdD works out as Src * Dst * 2
tmp = vout[i] * src * 2.0f;
// default is GL_BLEND here
// CsS + CdD works out as Src * Dst * 2
tmp = vout[i] * src * 2.0f;
// multiply back by 255 to get the proper byte scale
tmp *= 255.0f;
// multiply back by 255 to get the proper byte scale
tmp *= 255.0f;
// bound the temp target again now, cos the operation may have thrown it out
// bound the temp target again now, cos the operation may have thrown it out
tmp = bound( 0.0f, tmp, 255.0f );
// and copy it in
((byte *)&fout[y * image.width + x])[i] = (byte)tmp;
}
}
}
// and copy it in
((byte *)&fout[y * image.width + x])[i] = (byte)tmp;
}
}
}
// copy result back
memcpy( fin, fout, size );
@ -1468,7 +1468,7 @@ qboolean Image_Process( rgbdata_t **pix, int width, int height, uint flags, floa
rgbdata_t *pic = *pix;
qboolean result = true;
byte *out;
// check for buffers
if( !pic || !pic->buffer )
{

View File

@ -27,7 +27,7 @@ Image_LoadPAL
*/
qboolean Image_LoadPAL( const char *name, const byte *buffer, fs_offset_t filesize )
{
int rendermode = LUMP_NORMAL;
int rendermode = LUMP_NORMAL;
if( filesize != 768 )
{
@ -65,7 +65,7 @@ qboolean Image_LoadPAL( const char *name, const byte *buffer, fs_offset_t filesi
image.size = 1024; // expanded palette
image.width = image.height = 0;
image.depth = 1;
return true;
}
@ -88,7 +88,7 @@ qboolean Image_LoadFNT( const char *name, const byte *buffer, fs_offset_t filesi
return false;
memcpy( &font, buffer, sizeof( font ));
// last sixty four bytes - what the hell ????
size = sizeof( qfont_t ) - 4 + ( font.height * font.width * QCHAR_WIDTH ) + sizeof( short ) + 768 + 64;
@ -118,7 +118,7 @@ qboolean Image_LoadFNT( const char *name, const byte *buffer, fs_offset_t filesi
Image_GetPaletteLMP( pal, LUMP_MASKED );
image.flags |= IMAGE_HAS_ALPHA; // fonts always have transparency
}
else
else
{
return false;
}
@ -206,7 +206,7 @@ qboolean Image_LoadSPR( const char *name, const byte *buffer, fs_offset_t filesi
if( image.hint == IL_HINT_HL )
{
if( !image.d_currentpal )
return false;
return false;
}
else if( image.hint == IL_HINT_Q1 )
{
@ -244,7 +244,7 @@ qboolean Image_LoadSPR( const char *name, const byte *buffer, fs_offset_t filesi
SetBits( image.flags, IMAGE_HAS_ALPHA );
break;
}
fin = (byte *)(buffer + sizeof(dspriteframe_t));
if( truecolor )
@ -378,7 +378,7 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesi
pal = (byte *)buffer + mip.offsets[0] + (((image.width * image.height) * 85)>>6);
numcolors = *(short *)pal;
if( numcolors != 256 ) pal = NULL; // corrupted mip ?
else pal += sizeof( short ); // skip colorsize
else pal += sizeof( short ); // skip colorsize
hl_texture = true;
@ -474,7 +474,7 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesi
else
{
return false; // unknown or unsupported mode rejected
}
}
// check for quake-sky texture
if( !Q_strncmp( mip.name, "sky", 3 ) && image.width == ( image.height * 2 ))
@ -513,10 +513,10 @@ qboolean Image_LoadMIP( const char *name, const byte *buffer, fs_offset_t filesi
reflectivity[1] += pal[i*3+1];
reflectivity[2] += pal[i*3+2];
}
VectorDivide( reflectivity, 256, image.fogParams );
}
image.type = PF_INDEXED_32; // 32-bit palete
image.depth = 1;

View File

@ -196,7 +196,7 @@ const char *Info_ValueForKey( const char *s, const char *key )
static int valueindex;
int count;
char *o;
valueindex = (valueindex + 1) % 4;
if( *s == '\\' ) s++;

View File

@ -32,8 +32,9 @@ void COM_ResetLibraryError( void )
void COM_PushLibraryError( const char *error )
{
if( s_szLastError[0] )
Q_strncat( s_szLastError, "\n", sizeof( s_szLastError ) );
Q_strncat( s_szLastError, error, sizeof( s_szLastError ) );
Q_strncat( s_szLastError, "\n", sizeof( s_szLastError ) );
}
void *COM_FunctionFromName_SR( void *hInstance, const char *pName )

View File

@ -116,7 +116,7 @@
/* Defines to completely disable specific portions of miniz.c:
/* Defines to completely disable specific portions of miniz.c:
If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. */
/* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */
@ -139,7 +139,7 @@
/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user
functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */
@ -900,7 +900,7 @@ struct tinfl_decompressor_tag
#ifdef __cplusplus
}
#endif
#ifndef MINIZ_HEADER_FILE_ONLY
/**************************************************************************
*
@ -3849,5 +3849,5 @@ void tinfl_decompressor_free(tinfl_decompressor *pDecomp)
#ifdef __cplusplus
}
#endif
#endif // MINIZ_HEADER_FILE_ONLY

View File

@ -459,7 +459,7 @@ byte *Mod_DecompressPVS( const byte *in, int visbytes )
out = g_visdata;
if( !in )
{
{
// no vis info, so make all visible
while( visbytes )
{
@ -641,7 +641,7 @@ static void Mod_BoxLeafnums_r( leaflist_t *ll, mnode_t *node )
ll->list[ll->count++] = leaf->cluster;
return;
}
sides = BOX_ON_PLANE_SIDE( ll->mins, ll->maxs, node->plane );
if( sides == 1 )
@ -756,7 +756,7 @@ void Mod_AmbientLevels( const vec3_t p, byte *pvolumes )
mleaf_t *leaf;
if( !worldmodel || !p || !pvolumes )
return;
return;
leaf = Mod_PointInLeaf( p, worldmodel->nodes );
*(int *)pvolumes = *(int *)leaf->ambient_sound_level;
@ -802,8 +802,8 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve
Q_strncpy( keyname, token, sizeof( keyname ));
// parse value
if(( pfile = COM_ParseFile( pfile, token )) == NULL )
// parse value
if(( pfile = COM_ParseFile( pfile, token )) == NULL )
Host_Error( "Mod_FindModelOrigin: EOF without closing brace\n" );
if( token[0] == '}' )
@ -820,7 +820,7 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve
}
if( model_found ) break;
}
}
}
/*
@ -936,7 +936,7 @@ static mvertex_t *Mod_GetVertexByNumber( model_t *mod, int surfedge )
return &mod->vertexes[edge->v[1]];
}
}
/*
==================
Mod_MakeNormalAxial
@ -1032,7 +1032,7 @@ static void Mod_CalcSurfaceExtents( msurface_t *surf )
sample_size = Mod_SampleSizeForFace( surf );
tex = surf->texinfo;
Mod_LightMatrixFromTexMatrix( tex, info->lmvecs );
Mod_LightMatrixFromTexMatrix( tex, info->lmvecs );
mins[0] = lmmins[0] = mins[1] = lmmins[1] = 999999;
maxs[0] = lmmaxs[0] = maxs[1] = lmmaxs[1] =-999999;
@ -1276,9 +1276,9 @@ static void Mod_MakeHull0( void )
mclipnode_t *out;
hull_t *hull;
int i, j;
hull = &loadmodel->hulls[0];
hull->clipnodes = out = Mem_Malloc( loadmodel->mempool, loadmodel->numnodes * sizeof( *out ));
hull = &loadmodel->hulls[0];
hull->clipnodes = out = Mem_Malloc( loadmodel->mempool, loadmodel->numnodes * sizeof( *out ));
in = loadmodel->nodes;
hull->firstclipnode = 0;
@ -1502,7 +1502,7 @@ static void Mod_SetupSubmodels( dbspmodel_t *bmod )
mod->firstmodelsurface = bm->firstface;
mod->nummodelsurfaces = bm->numfaces;
VectorCopy( bm->mins, mod->mins );
VectorCopy( bm->mins, mod->mins );
VectorCopy( bm->maxs, mod->maxs );
mod->radius = RadiusFromBounds( mod->mins, mod->maxs );
@ -1596,7 +1596,7 @@ static void Mod_LoadSubmodels( dbspmodel_t *bmod )
if( in->mins[j] == 999999.0f )
in->mins[j] = 0.0f;
if( in->maxs[j] == -999999.0f)
in->maxs[j] = 0.0f;
in->maxs[j] = 0.0f;
// spread the mins / maxs by a unit
out->mins[j] = in->mins[j] - 1.0f;
@ -1613,7 +1613,7 @@ static void Mod_LoadSubmodels( dbspmodel_t *bmod )
if( i == 0 && bmod->isworld )
continue; // skip the world to save mem
oldmaxfaces = Q_max( oldmaxfaces, out->numfaces );
oldmaxfaces = Q_max( oldmaxfaces, out->numfaces );
}
// these array used to sort translucent faces in bmodels
@ -1693,8 +1693,8 @@ static void Mod_LoadEntities( dbspmodel_t *bmod )
Q_strncpy( keyname, token, sizeof( keyname ));
// parse value
if(( pfile = COM_ParseFile( pfile, token )) == NULL )
// parse value
if(( pfile = COM_ParseFile( pfile, token )) == NULL )
Host_Error( "Mod_LoadEntities: EOF without closing brace\n" );
if( token[0] == '}' )
@ -1908,7 +1908,7 @@ static void Mod_LoadTextures( dbspmodel_t *bmod )
qboolean custom_palette;
char texname[64];
mip_t *mt;
int i, j;
int i, j;
if( bmod->isworld )
{
@ -2574,7 +2574,7 @@ static void Mod_LoadClipnodes( dbspmodel_t *bmod )
dclipnode32_t *out;
int i;
bmod->clipnodes_out = out = (dclipnode32_t *)Mem_Malloc( loadmodel->mempool, bmod->numclipnodes * sizeof( *out ));
bmod->clipnodes_out = out = (dclipnode32_t *)Mem_Malloc( loadmodel->mempool, bmod->numclipnodes * sizeof( *out ));
if(( bmod->version == QBSP2_VERSION ) || ( bmod->version == HLBSP_VERSION && bmod->numclipnodes >= MAX_MAP_CLIPNODES ))
{
@ -2801,7 +2801,7 @@ qboolean Mod_LoadBmodelLumps( const byte *mod_base, qboolean isworld )
{
Con_DPrintf( "Mod_Load%s: %i error(s), %i warning(s)\n", isworld ? "World" : "Brush", loadstat.numerrors, loadstat.numwarnings );
return false; // there were errors, we can't load this map
}
}
else if( !bmod->isworld && loadstat.numwarnings )
Con_DPrintf( "Mod_Load%s: %i warning(s)\n", isworld ? "World" : "Brush", loadstat.numwarnings );
@ -2915,7 +2915,7 @@ qboolean Mod_TestBmodelLumps( const char *name, const byte *mod_base, qboolean s
if( !FBitSet( flags, LUMP_SILENT ))
Con_Printf( "Mod_LoadWorld: %i error(s), %i warning(s)\n", loadstat.numerrors, loadstat.numwarnings );
return false; // there were errors, we can't load this map
}
}
else if( loadstat.numwarnings )
{
if( !FBitSet( flags, LUMP_SILENT ))
@ -2932,7 +2932,7 @@ Mod_LoadBrushModel
*/
void Mod_LoadBrushModel( model_t *mod, const void *buffer, qboolean *loaded )
{
if( loaded ) *loaded = false;
if( loaded ) *loaded = false;
loadmodel->mempool = Mem_AllocPool( va( "^2%s^7", loadmodel->name ));
loadmodel->type = mod_brush;

View File

@ -267,7 +267,7 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
if( SV_IsValidEdict( pEdict ) && pEdict->v.gamestate == 1 )
bSkipShield = 1;
for( i = j = 0; i < mod_studiohdr->numhitboxes; i++, j += 6 )
{
if( bSkipShield && i == 21 )
@ -310,7 +310,7 @@ static void Mod_StudioCalcBoneAdj( float *adj, const byte *pcontroller )
int i, j;
float value;
mstudiobonecontroller_t *pbonecontroller;
pbonecontroller = (mstudiobonecontroller_t *)((byte *)mod_studiohdr + mod_studiohdr->bonecontrollerindex);
for( j = 0; j < mod_studiohdr->numbonecontrollers; j++ )
@ -420,12 +420,12 @@ void R_StudioCalcBoneQuaternion( int frame, float s, mstudiobone_t *pbone, mstud
mstudioanimvalue_t *panimvalue = (mstudioanimvalue_t *)((byte *)panim + panim->offset[j+3]);
k = frame;
// debug
if( panimvalue->num.total < panimvalue->num.valid )
k = 0;
// find span of values that includes the frame we want
// find span of values that includes the frame we want
while( panimvalue->num.total <= k )
{
k -= panimvalue->num.total;
@ -734,7 +734,7 @@ static void SV_StudioSetupBones( model_t *pModel, float frame, int sequence, con
i = boneused[j];
Matrix3x4_FromOriginQuat( bonematrix, q[i], pos[i] );
if( pbones[i].parent == -1 )
if( pbones[i].parent == -1 )
Matrix3x4_ConcatTransforms( studio_bones[i], studio_transform, bonematrix );
else Matrix3x4_ConcatTransforms( studio_bones[i], studio_bones[pbones[i].parent], bonematrix );
}
@ -1025,7 +1025,7 @@ studiohdr_t *R_StudioLoadHeader( model_t *mod, const void *buffer )
{
Con_Printf( S_ERROR "%s has wrong version number (%i should be %i)\n", mod->name, i, STUDIO_VERSION );
return NULL;
}
}
return (studiohdr_t *)buffer;
}
@ -1154,7 +1154,7 @@ static server_studio_api_t gStudioAPI =
Mod_LoadCacheFile,
Mod_StudioExtradata,
};
/*
===============
Mod_InitStudioAPI

View File

@ -51,7 +51,7 @@ void MSG_InitMasks( void )
for( maskBit = 0; maskBit < 32; maskBit++ )
ExtraMasks[maskBit] = (uint)BIT( maskBit ) - 1;
}
void MSG_InitExt( sizebuf_t *sb, const char *pDebugName, void *pData, int nBytes, int nMaxBits )
{
MSG_StartWriting( sb, pData, nBytes, 0, nMaxBits );
@ -119,7 +119,7 @@ int MSG_SeekToBit( sizebuf_t *sb, int bitPos, int whence )
case SEEK_END:
bitPos += sb->nDataBits;
break;
default:
default:
return -1;
}
@ -252,7 +252,7 @@ qboolean MSG_WriteBits( sizebuf_t *sb, const void *pData, int nBits )
nBitsLeft -= 8;
++pOut;
}
// Read the remaining bits.
if( nBitsLeft )
{
@ -391,7 +391,7 @@ qboolean MSG_WriteString( sizebuf_t *sb, const char *pStr )
} while( *( pStr - 1 ));
}
else MSG_WriteChar( sb, 0 );
return !sb->bOverflow;
}
@ -446,7 +446,7 @@ uint MSG_ReadUBitLong( sizebuf_t *sb, int numbits )
{
int nExtraBits = sb->iCurBit & 31;
uint dword2 = ((uint *)sb->pData)[idword1+1] & ExtraMasks[nExtraBits];
// no need to mask since we hit the end of the dword.
// shift the second dword's part into the high bits.
ret |= (dword2 << ( numbits - nExtraBits ));
@ -484,7 +484,7 @@ qboolean MSG_ReadBits( sizebuf_t *sb, void *pOutData, int nBits )
{
byte *pOut = (byte *)pOutData;
int nBitsLeft = nBits;
// get output dword-aligned.
while((( dword )pOut & 3) != 0 && nBitsLeft >= 8 )
{
@ -508,7 +508,7 @@ qboolean MSG_ReadBits( sizebuf_t *sb, void *pOutData, int nBits )
++pOut;
nBitsLeft -= 8;
}
// read the remaining bits.
if( nBitsLeft )
{
@ -529,7 +529,7 @@ float MSG_ReadBitAngle( sizebuf_t *sb, int numbits )
fReturn = (float)i * ( 360.0f / shift );
// clamp the finale angle
if( fReturn < -180.0f ) fReturn += 360.0f;
if( fReturn < -180.0f ) fReturn += 360.0f;
else if( fReturn > 180.0f ) fReturn -= 360.0f;
return fReturn;
@ -646,7 +646,7 @@ char *MSG_ReadStringExt( sizebuf_t *sb, qboolean bLine )
{
static char string[4096];
int l = 0, c;
do
{
// use MSG_ReadByte so -1 is out of bounds

Some files were not shown because too many files have changed in this diff Show More