Fine-grained CD volume for NetBSD. Made the CD error message "Bad track number" a normal (non-developer) message. Zeroed the 3rd and 4th channel volumes in the Linux CD module too. The initial CD volume is now printed at startup (developer message).
renamed r_shadow_worldshadows to r_shadow_realtime_world_shadows
renamed r_shadow_dlightshadows to r_shadow_realtime_dlight_shadows, and added r_shadow_realtime_world_dlightshadows to control dlight shadows in realtime world mode
Fine-grained CD volume support for Linux. Note that it uses the CD player internal volume, not the system audio mixer. The BSD version should follow very soon; if someone knows how to do that on Win32, I would be glad to hear from him.
Fixed streaming of sounds with a sample rate different from the engine output rate. Streamed sounds are now processed by 1 sec steps, to avoid lossing samples in ResampleSfx among other things (it could occur when resampling from 48KHz to 44KHz for instance).
r_ambient no longer alters the lightmap in q1bsp, instead it adds another render pass (this makes sense for performance as it's a cheat anyway, no optimization needed)
renamed model->numsurfaces to model->nummodelsurfaces
renamed model->brushq1.firstmodelsurface and model->brushq1.nummodelsurfaces to model->firstmodelsurface and model->nummodelsurfaces
patch from transfusion team to change transfusion hud layout a bit (moves minideathmatch overlay to be across the top of the screen, and centers the sbar even in deathmatch)
The first step towards a real CD volume setting (only the fake CD tracks volume are correctly supported for the moment). Removed a couple of useless definitions in "sound.h".
Added a "log_file" cvar to control the log file name (default: "" which means no log, "-condebug" sets it to "qconsole.log"). Added a "log_sync" cvar to control whether or not the log output is flushed at each write (default: 0, "-condebug" sets it to 1).
Note that we now need to wait until the cvars are initialized to start logging the console, so the logging system puts every message printed before that in a logging queue that is proceed when the log file is actually opened.
Renamed "Con_LogPrint" and "Con_LogPrintf" to "Log_Print" and "Log_Printf" respectively. Added "FS_VPrintf"
Fake CD tracks support; DP now tries to play "sound/cdtracks/trackXX.wav" instead of CD track XX. If it fails, it tries "trackXX.ogg", and then the real CD track if any. CD console commands should work as expected.
"cd_shared.c" is now part of the common files so it allows people to compile DP without real CD support, but with fake CD tracks support. "cd_null.c" is now a null driver, at the same level as "cd_linux.c" or "cd_win.c".
Fixed the broken return value of S_StartSound and a potential memory leak in S_StopAllSounds in the process.
inlined Host_EndGame in CL_ParseServerMessage's svc_disconnect case and greatly reduced its code (removing the server shutdown, etc), this fixed an infinite recursion shutdown crash introduced by the Host_ShutdownServer changes
fixed very annoying '5 second timeout' bug in Host_ShutdownServer (the local client was timing out on the NetConn_SendToAll because the server was ignoring the client's reply packets, by setting sv.active = false too early)
added Host_ShutdownServer call near every CL_Disconnect call, for consistency
CL_Disconnect and Host_ShutdownServer now report their calls as dprints (previously they were entirely silent)
Added a CHANNELFLAG_LOCALSOUND flag for channels playing a client-side sound, such as menu sounds for instance. Added the ability to pause/resume channels. When the game is paused, all non-local sounds are now automatically paused (previously, no new sound was started during the pause, but those already created were played normally).
molivier [Wed, 24 Mar 2004 08:06:56 +0000 (08:06 +0000)]
Fixed the sounds not being advanced in time while not being listened. This is a long standing bug I think, it looks like the original Quake source code has it too, though I haven't tested. Each channel now remembers the last time it was painted, and so it can resume the play at the appropriate position if it missed some painting rounds.
Also, added a check to avoid looped sounds being overridden when picking a channel.
molivier [Tue, 23 Mar 2004 08:28:28 +0000 (08:28 +0000)]
Ogg vorbis streaming support; the code decides whether it will cache or stream the sound depending on the file and uncompressed sound sizes. It should be stable enough for a regular use now; you lose a few FPS once every second or so of course, it's not free, but you can expect the Vorbis stream to use between 5 and 12 times less memory than before, depending on the sound quality and the number of SFX sources using it. This patch also contains a couple of fixes (a pretty annoying typo in the OSS and BSD driver - 22051Hz instead of 22050Hz, and a potential memory leak in WAV loader)
havoc [Mon, 22 Mar 2004 10:04:48 +0000 (10:04 +0000)]
worked around an ATI driver bug with glColor during GL_EXT_compiled_vertex_array locks being ignored - R_Shadow_RenderLighting dot3 paths now lock around each pass instead of the whole set of final passes - ATI PLEASE FIX THIS, the GL_EXT_compiled_vertex_array spec says all settings can be changed during a lock!
reorganized R_Shadow_RenderLighting to reduce code duplication a bit
enabled scissor without stencil support (the bug was in the lack of a valid projectmatrix)
added 3 tmu vertex lighting path (uses XYZ attenuation via textures, and vertex shading) which is mainly for use on 3+ tmu cards in 16bit color mode
renamed R_Shadow_VertexLighting functions to R_Shadow_VertexShading and made their names more clear
fixed a bug in the R_Shadow_VertexShading math (now normalizes the vertex->light vector as well as normal vector)
made some functions static
added an #ifndef USETEXMATRIX around the cpu matrix transform functions as they're not used anymore due to USETEXMATRIX code
havoc [Mon, 22 Mar 2004 09:22:38 +0000 (09:22 +0000)]
fix scissoring bugs with r_shadow_realtime_dlight - the projectmatrix was not being set for glFrustum and glOrtho cases, now it is (by reading back from GL)
havoc [Mon, 15 Mar 2004 07:00:14 +0000 (07:00 +0000)]
3d texcoords now must use rmeshstate_t.pointer_texcoord3f instead of pointer_texcoord, this allows texture matrices and such
implemented (broken and disabled) texture matrix optimizations in R_Shadow_RenderLighting, I'm still trying to figure out what is wrong
havoc [Mon, 15 Mar 2004 05:27:02 +0000 (05:27 +0000)]
reorganized texture setup code in R_Shadow_RenderLighting to be cleaner, fixed CVA locking in voodoo1/2 paths (it was locked while the color array update was happening, no good)
havoc [Sun, 14 Mar 2004 05:31:45 +0000 (05:31 +0000)]
got rid of Cshader system as it really wasn't helping anything, now all surfaces types use one R_DrawSurfaceChain function, which calls the appropriate passes
havoc [Sat, 13 Mar 2004 23:30:20 +0000 (23:30 +0000)]
merged static and dynamic rtlight handling almost entirely (even uses DrawShadowVolume and DrawLight to generate cached meshes - however this currently lost the r_shadow_portallight optimizations)
added a surfacelist to model_t containing surface indices for each submodel
merged R_Shadow_DiffuseLighting and R_Shadow_SpecularLighting into R_Shadow_RenderLighting (which takes a lighting parameter containing LIGHTING_DIFFUSE and LIGHTING_SPECULAR flags)
commented out cullradius/cullradius2 in rtlight structs because they weren't used
havoc [Sat, 13 Mar 2004 23:26:17 +0000 (23:26 +0000)]
added texmatrix[] to rmeshstate_t and removed R_Mesh_TextureMatrix function
reorganized water rendering code to make it a lot less confusing (especially the r_watershader code)
molivier [Thu, 11 Mar 2004 08:08:04 +0000 (08:08 +0000)]
Changed the way DP detects and handles the CPU endianess. All the tests are done at compile time now. Tested on Win32 (MSVC6 and MinGW32), Linux and NetBSD; should also work on the other BSDs.
havoc [Wed, 10 Mar 2004 21:40:02 +0000 (21:40 +0000)]
now calls GL_LockArrays manually around each R_Mesh_Draw call instead of locking inside R_Mesh_Draw, so some things can render the same geometry repeatedly (shadow volumes and lighting) without unlocking)