Commit Graph
100 Commits
Author SHA1 Message Date
Zack Middleton d092ba6627 Fix restoring fs_game when default.cfg is missing. 2012-10-26 01:27:16 +00:00
Zack Middleton 037565293f From /dev/humancontroller:
to further reduce confusion, rename constants like MAX_ENTITIES to MAX_REFENTITIES
2012-10-17 21:20:29 +00:00
Zack Middleton bc4ca164e0 From /dev/humancontroller:
really fix the confusion with game entity and refentity numbers

for any natural number M, the following is logical as a whole:
- the array size for refentities is M;
- the refentity number limit is M-1, ie., each refentity number is in [0..M-1];
- the special number for the world is M.

before r1429, the code was roughly the following:

// constants related to the game, should not be used by the renderer

// renderer stuff
refEntity_t refEntities[MAX_ENTITIES];
int numRefEntities = 0;

void addRefEntity(refEntity_t re)
{
	if (numRefEntities >= ENTITYNUM_WORLD)
		return; // full
	refEntities[numRefEntities++] = re;
}

void render(int num)
{
	if (num == ENTITYNUM_WORLD)
		renderWorld();
	else
		renderRefEntity(refEntities[num]);
}

so before r1429,
- the array size for refentities was 1023;
- the refentity number limit was 1021, ie., each refentity number was in [0..1021]; and
- the special number for the world entity was 1022.
this was a small waste of memory, as the last array element wasn't used.

r1429 changed
	if (numRefEntities >= ENTITYNUM_WORLD)
to
	if (numRefEntities >= MAX_ENTITIES).

this creates the following configuration:
- the array size for refentities is 1023;
- the refentity number limit is 1022, ie., each refentity number is in [0..1022]; and
- the special number for the world entity is 1022.

r1429 just makes things worse: it allows 1 more refentity to be added, but that entity doesn't get drawn anyway, as its number will be equal to the special number for the world. this is a small waste of not only memory, but also processing time.

perhaps in XreaL,

ENTITYNUM_WORLD is a game entity constant, and has nothing to do with refentities. a new REFENTITYNUM_WORLD constant should be added to denote the special number for the world, and that constant should be used in the renderer code in place of ENTITYNUM_WORLD. so define such a constant, and let it be equal to MAX_ENTITIES, which is 1023.
2012-10-17 21:17:37 +00:00
Zack Middleton d49d0753eb When in third person, don't play player's sounds as full volume in Base sound system. OpenAL already does this. (Related to bug 5741.) 2012-10-17 20:39:45 +00:00
Zack Middleton ce9f2ee5f9 Check last listener number instead of clc.clientNum in S_AL_HearingThroughEntity so sound work correctly when spectate following a client. (Related to bug 5741.) 2012-10-17 19:30:41 +00:00
Zack Middleton 0167b439c9 Don't include client.h in sdl_glimp.c as it is part of the external renderer lib. 2012-10-13 23:15:02 +00:00
Zack Middleton 0a8eb09834 Play correct team sounds when in spectator mode and following a player. 2012-10-11 18:22:41 +00:00
Zack Middleton cf30922932 Fix resetting single player level selection in q3_ui when there is no training level, such as in demoq3. 2012-09-30 06:21:08 +00:00
Zack Middleton a32dc4dca4 Fix arrow buttons in q3_ui join server menu to be selectable by mouse. 2012-09-30 03:59:10 +00:00
Zack Middleton 656a0145bc Added myself to ioq3 credits in q3_ui. 2012-09-30 03:10:10 +00:00
Zack Middleton 11811e8138 Fix UI player model FOV when using non-640x480 resolution. 2012-09-30 02:56:50 +00:00
Zack Middleton 2cb7f25093 Cache servers for each master server in q3_ui, otherwise servers from last updated master for shown for all Internet# sources. 2012-09-17 04:16:30 +00:00
Zack Middleton 02f3664b2e Fix game getting stuck in a do-while loop when "team follow1" or "team follow2" client sends a follownext or followprev command. 2012-09-10 01:22:13 +00:00
Zack Middleton c65142179f Fix g_warmup < 2 causing client prediction issues (bug #5740). (Reused code for tournament gametype.) 2012-09-09 22:14:15 +00:00
Zack Middleton e3fc1826b1 Send team info for team overlay to spectators for the team of the client they're following (bug #5740). 2012-09-08 23:19:06 +00:00
Zack Middleton 56ebe14239 Don't have g_teamAutoJoin affect bot's team
Bots set their team later, setting it here causes some bots to change team and die later. Can cause extra skulls to be spawn at beginning of harvester (bug #5740).
2012-09-08 22:32:41 +00:00
Zack Middleton b4a76e74f7 Remove a redundant code statement. 2012-09-04 21:13:25 +00:00
Zack Middleton 1aaf9d3e7b Use correct fallback height and width for r_mode -2. 2012-08-27 15:38:55 +00:00
Zack Middleton 42d3ff8d1d Added r_mode -2, uses desktop resolution. Bug #5408. Patch by Andrei Drexler and myself. 2012-08-27 14:52:41 +00:00
Zack Middleton a3ae0dc5ef Removed a check that was made unnessicary by r1644. 2012-08-24 18:04:44 +00:00
Zack Middleton dc8b48855d More MISSIONPACK ifdeffery. 2012-08-17 19:05:40 +00:00
Zack Middleton 9a69b738bf Added MISSIONPACK ifdef around GT_1FCTF code. 2012-08-17 06:18:37 +00:00
Zack Middleton b82c02fc03 Don't replay to status OOB requests in Team Arena single player. 2012-08-16 21:38:02 +00:00
Zack Middleton 79bb668a9f Fixed G_LogPrintf format warning on 64 bit systems added in r2294. 2012-07-05 13:42:08 +00:00
Zack Middleton 2cfda4384b We should not try to broadcast via the IPv4 socket if that socket is closed.
Previously, error messages were generated when querying local servers while IPv4 was disabled. Patch from /dev/humancontroller.
2012-07-05 13:33:55 +00:00
Zack Middleton b340c9d835 Fixed fatal error ("OP_BLOCK_COPY out of range!") when using qvms on Mac OS X powerpc (see r2031 and r2034). 2012-06-29 18:35:55 +00:00
Zack Middleton 3b09685b42 - Have NET_Sleep work with Windows' INVALID_SOCKET again...
- Use SOCKET_ERROR in NET_Sleep.
2012-06-19 22:36:54 +00:00
Zack Middleton 725c9df608 #5672 - Fixed incorrect type usage in NET_Sleep(), patch from Özkan Sezer. 2012-06-19 16:12:16 +00:00
Zack Middleton 68b3b0922b static-ize inline functions for Clang/LLVM
From /dev/humancontroller.
2012-06-19 15:56:21 +00:00
Zack Middleton afa607c3b6 Added kicknum, kickall, and kickbots commands, patch by Ensiform. 2012-06-19 15:52:08 +00:00
Zack Middleton 945f01d4af more '\n' business
From /dev/humancontroller.
2012-06-19 15:14:57 +00:00
Zack Middleton 4cfbbe506c when interacting with QVMs, Clang/LLVM requires the standard use of the va_*() macros instead of (fast) call hacks
From /dev/humancontroller.
2012-06-19 14:57:51 +00:00
Zack Middleton 64c26ec338 fix a WRONG size argument to a memset() call found by Clang/LLVM
From /dev/humancontroller.
2012-06-19 14:53:40 +00:00
Zack Middleton 2db73231eb remove a bunch of superfluous formatting calls
From /dev/humancontroller.
2012-06-19 14:52:22 +00:00
Zack Middleton 20c6d1e33f rename trap_Printf() to trap_Print() in the game module, as that function has nothing to do with printf()-like formatting
From /dev/humancontroller.
2012-06-19 14:51:02 +00:00
Zack Middleton 6067cadc72 Removed 0xAD character, from /dev/humancontroller. 2012-06-19 14:47:30 +00:00
Zack Middleton c26289374b Fixed typo in README from r2275. 2012-06-19 14:20:42 +00:00
Zack Middleton 2a4f775d6c Fixed comment in server.h (ent->v.absmax to ent->r.absmax). 2012-06-18 22:25:35 +00:00
Zack Middleton 5b25b3469b Added execq to README. 2012-06-18 20:38:24 +00:00
Zack Middleton cd3654a21f Only have bots issue vtaunt commands in Team Arena. 2012-06-18 20:11:09 +00:00
Zack Middleton f40042113a Let's actually use MOD_CHAINGUN! From Ensiform. 2012-06-18 17:12:35 +00:00
Zack Middleton 56a918b9ac Made more code for Team Arena be inside ifdef MISSIONPACK, from Ensiform. 2012-06-18 17:09:33 +00:00
Zack Middleton a375f898f5 REFACTOR [anough to enough] 2012-06-18 16:39:58 +00:00
Zack Middleton 2579738256 Removed unneeded va() and use CG_Error instead of trap_Error in cgame. Found by Ensiform. 2012-06-18 16:36:21 +00:00
Zack Middleton 1d70ffc9b2 fix the usage description of the clientkick server command (also rename SV_KickNum_f() to SV_ClientKick_f())
found by Ensiform
2012-06-18 16:33:13 +00:00
Zack Middleton ad5c5c32a6 REFACTOR [reletive -> relative]
From /dev/humancontroller.
2012-06-18 16:32:03 +00:00
Zack Middleton f3e7012bdb REFACTOR [a vs an]
From /dev/humancontroller.
2012-06-18 16:31:16 +00:00
Zack Middleton 4bd24d3182 never set groundEntityNum to -1, use ENTITYNUM_NONE instead
From /dev/humancontroller.
2012-06-18 16:28:39 +00:00
Zack Middleton 7f9a04fd80 REFACTOR
From /dev/humancontroller.
2012-06-18 16:27:00 +00:00
Zack Middleton 997615168a fix some typos
From /dev/humancontroller.
2012-06-18 16:25:13 +00:00
Zack Middleton ad8d3dc567 remove a bunch of unused stuff from game
From /dev/humancontroller.
2012-06-18 16:23:43 +00:00
Zack Middleton af90948182 bring some freeish()ing operations ahead from after Errorish() calls
From /dev/humancontroller.
2012-06-18 16:17:39 +00:00
Zack Middleton a4c61d874d add a missing '\n', remove some unwanted ones
From /dev/humancontroller.
2012-06-18 16:16:57 +00:00
Zack Middleton c3ca5c1caa non-missionpack build throws up a few "0" plums
found by Ensiform
2012-06-18 16:14:48 +00:00
Zack Middleton 2834a58600 add missing commands to autocompletition
found by Ensiform
2012-06-18 16:11:35 +00:00
Zack Middleton 62f7fab62e add the "execq" command, a more quiet version of the "exec" command
in exec/execq, always print the extension for the filename

From /dev/humancontroller.
2012-06-18 16:09:14 +00:00
Zack Middleton 6ff3b03376 fix IPv6-only operation of Windows binaries
the SOCKET type is unsigned on Windows, and should be casted to an int before comparing with the highestfd variable (note: ``int highestfd = -1;'')

From /dev/humancontroller.
2012-06-18 16:05:47 +00:00
Zack Middleton c16338cfa9 fix wrong socket ID comparison, from /dev/humancontroller 2012-06-18 16:03:06 +00:00
Zack Middleton 2131536d07 Call sound files 'audio' not 'wav' in debug messages. 2012-06-18 16:00:38 +00:00
Zack Middleton a17dafc5e7 Cleaned up game server command usage messages. 2012-06-18 15:58:48 +00:00
Zack Middleton fb1f629bbc Removed unnessicary "!!". 2012-06-01 19:49:07 +00:00
Zack Middleton 22ecd68cf2 In CheckTeamLeader, make sure to only set one client as team leader. Reported by Tobias Kuehnhammer. 2012-05-20 21:22:11 +00:00
Zack Middleton 73a5f01baf Don't use local SDL headers on Linux (need system sdl-config and SDL library anyway). 2012-05-07 23:31:38 +00:00
Zack Middleton 5abf7e3d84 #5503 - SIGSEGV with r_vertexlight 1 in missionpack (patch by Serge Belyshev). 2012-05-07 23:06:00 +00:00
Zack Middleton 2c5d0c1e3a Fixed two issues pointed out in a PVS-Studio static code analyzer article (bug #5505). 2012-05-07 22:47:19 +00:00
Zack Middleton c211114cb0 #5462 - do not require clients to have a matching qagame.qvm (adapted from OpenArena) 2012-05-07 22:26:03 +00:00
Zack Middleton 1db2124a65 Moved dpi variable inside BUILD_FREETYPE ifdef. 2012-04-07 16:34:21 +00:00
Zack Middleton a55a059abc Fixed some issues found using clang static analyzer. 2012-04-07 02:53:42 +00:00
Zack Middleton ce3ec3ceef #5453 - Tell command for server. 2012-04-05 22:43:32 +00:00
Zack Middleton 395225cb7e #5439 - Potential memory leak in host name resolution. (Eugene C.) 2012-04-05 21:29:51 +00:00
Zack Middleton 88020d5fb8 #5485 - Use Sys_LoadDll to search in the local directory for the fallback default renderer. Patch by Harley Laue. 2012-04-04 17:21:17 +00:00
Zack Middleton 021ce233b2 #5484 - Remove unneeded tr_local.h include from sdl_input.c. Patch by Harley Laue. 2012-04-04 17:16:11 +00:00
Zack Middleton b211b35853 Use FreeType include macros instead of filenames directly (per the API docs), patch by Radegast. 2012-04-02 17:23:46 +00:00
Zack Middleton de1360f268 Fixed up warning messages in tr_font.c 2012-03-29 06:35:33 +00:00
Zack Middleton c8e790e4af Use tabs in tr_font.c 2012-03-29 05:42:30 +00:00
Zack Middleton 5e9c7f5b37 Removed set but not used variable 'satLevels' from tr_font.c. 2012-03-29 05:31:18 +00:00
Zack Middleton 4b7a623cc0 Make sure font glyph shader names are null-terminated. 2012-03-29 05:28:09 +00:00
Zack Middleton 94fb80f021 Fixed possibly placing a font glyph (at the beginning of a row) past the bottom of a font cache image. 2012-03-29 05:15:46 +00:00
Zack Middleton f15a3cca21 Fixed writing pre-rendered font TGAs, needed to flip image. 2012-03-29 04:49:36 +00:00
Zack Middleton ea0102d403 - Added support for enabling FreeType Support (make USE_FREETYPE=1).
- Fixed compiling tr_font.c for dynamic renderer.
2012-03-29 04:05:13 +00:00
Zack Middleton 33d66c8034 Added range checks to j_*_axis cvars. 2012-02-15 18:47:50 +00:00
Zack Middleton 7a1efc19a4 Support up to 16 joystick axes, select which to use with j_*_axis cvars. 2012-02-15 18:26:08 +00:00
Zack Middleton 76c4346463 Added new joystick cvars to README. 2012-02-15 18:15:49 +00:00
Zack Middleton 91fd58f6e4 Allow analog joystick up axis to be remapped too. 2012-02-15 18:09:24 +00:00
Zack Middleton 7d8b751afd Patches by symlink.
#5313 - EF_CONNECTION set on wrong eFlags
#5314 - snc drawn in nirvana instead at lagometer
2012-02-06 21:28:40 +00:00
Zack Middleton c84377854a Unix clients can now enter commands from tty console. Patch by Rambetter with some edits by me. (#4799) 2012-02-06 21:05:57 +00:00
Zack Middleton 5729c8c518 Changed three filename buffers to be MAX_QPATH (not MAX_QPATH*2), filename lengths are limited to MAX_QPATH by engine and elsewhere in game logic. 2012-01-17 23:06:06 +00:00
Zack Middleton 73744a84c6 Fixed UI to use MAX_QPATH for skin filename buffer length. 2012-01-17 22:38:49 +00:00
Zack Middleton bdf1af34dc Fixed typo in Makefiles copyfiles directory path check. 2011-12-10 00:37:59 +00:00
Zack Middleton 34b22e9119 Reverted r2209... 2011-12-08 23:34:51 +00:00
Zack Middleton 93d1d0f83e Show warning when renderer cannot load model after checking all supported formats, instead of after each format. 2011-12-08 23:17:37 +00:00
Zack Middleton 2fbf9d9006 Removed unused functoin Hunk_Trash. 2011-12-08 22:54:45 +00:00
Zack Middleton a5c88d0e0d Removed an unused variable (which wasn't compiled in as _DEBUG isn't defined using make). 2011-12-08 22:53:58 +00:00
Zack Middleton 7b2f842053 Show file/line/label in Com_Error messages when run out of memory in debug build. 2011-12-08 22:25:25 +00:00
Zack Middleton 5c1ddf4020 Enable zone and hunk debug in debug build. 2011-12-08 22:24:48 +00:00
Zack Middleton 943d94bf0b Use GENTITYNUM_BITS for jumppad_ent bits. 2011-12-03 20:27:18 +00:00
Zack Middleton fe64955c0c Removed duplicate setting of contents for trigger_hurt. 2011-11-28 17:36:58 +00:00
Zack Middleton 88e9d66633 Disable blood on HUD when com_blood is 0. 2011-11-18 21:36:59 +00:00
Zack Middleton fd0d156338 Added missing newlines to game dedicated chat messages. 2011-11-10 04:49:07 +00:00
Zack Middleton 0724458818 Fixed usage of various entity defines. 2011-11-05 01:02:35 +00:00