Better output to /dev/dsp
This commit is contained in:
parent
4ee39a40f3
commit
53519b8512
5 changed files with 32 additions and 20 deletions
|
@ -1243,9 +1243,6 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer, loadedfile_t *brush_fileinf
|
|||
truecolor = (int)r_truecolor->value; // sanity check
|
||||
lowworld = (int)r_lowworld->value; // sanity check
|
||||
ditheredrend = (int)r_dither->value; // sanity checking also
|
||||
|
||||
|
||||
|
||||
|
||||
// FogTableRefresh();
|
||||
if (nolookups){
|
||||
|
|
|
@ -1371,12 +1371,16 @@ void R_DrawSurface (void)
|
|||
{
|
||||
#ifndef EXPREND
|
||||
if (lowworld){
|
||||
if (coloredlights == 1)
|
||||
if (coloredmethod) pblockdrawer = surfmiptable888RGB[r_drawsurf.surfmip]; // 18-bit lookups
|
||||
else pblockdrawer = surfmiptable8RGBX[r_drawsurf.surfmip]; // 18-bit lookups
|
||||
else if (coloredlights == 2)
|
||||
if (coloredlights == 1)
|
||||
{
|
||||
if (coloredmethod)
|
||||
pblockdrawer = surfmiptable888RGB[r_drawsurf.surfmip]; // 18-bit lookups
|
||||
else
|
||||
pblockdrawer = surfmiptable8RGBX[r_drawsurf.surfmip]; // 18-bit lookups
|
||||
}
|
||||
else if (coloredlights == 2)
|
||||
pblockdrawer = surfmiptable8RGBXD[r_drawsurf.surfmip]; // 18-bit lookups
|
||||
else
|
||||
else
|
||||
pblockdrawer = surfmiptablefast[r_drawsurf.surfmip]; // use old fashioned grays
|
||||
|
||||
|
||||
|
@ -3891,4 +3895,4 @@ void R_BuildSurfaceDisplayList (msurface_t *fa)
|
|||
|
||||
poly->numverts = lnumverts;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -423,10 +423,6 @@ qboolean SNDDMA_Init (void)
|
|||
|
||||
if (snd_useoss)
|
||||
result = SNDDMA_InitOSS ();
|
||||
#ifdef RQM_ALSA_TEST
|
||||
else
|
||||
result = SNDDMA_InitALSA ();
|
||||
#endif
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include "dumb.h"
|
||||
|
||||
int Tracker_Init(void);
|
||||
void Tracker_Play(byte track, qboolean looping);
|
||||
void Tracker_Stop(void);
|
||||
|
|
|
@ -20,13 +20,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "dumb.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/wait.h>
|
||||
#include <linux/soundcard.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
// eukara - added in tracker playback using DUMB - UNIX ONLY!
|
||||
char name[256];
|
||||
DUH *trackmod; // The music file ~eukara
|
||||
DUH_SIGRENDERER *sr; // The DUMB renderer
|
||||
FILE *oss_device; // output device (by default /dev/dsp for OSS)
|
||||
int oss_device; // output device (by default /dev/dsp for OSS)
|
||||
|
||||
// Set up the renderer options
|
||||
static int depth = 16; // by default 16bit, only affects output not internal 32bit processing
|
||||
|
@ -177,15 +186,19 @@ void Tracker_Update(void)
|
|||
}
|
||||
|
||||
// TODO: Write this into the engine's soundbuffer instead for speed!
|
||||
fwrite(buffer.s8, 1, l * n_channels * (depth >> 3), oss_device); // write it into OSS' device
|
||||
write (oss_device, &buffer, 4096);
|
||||
}
|
||||
|
||||
int Tracker_Init(void)
|
||||
{
|
||||
oss_device = fopen("/dev/dsp", "wb"); // /dev/dsp is the standard OSS output
|
||||
if((oss_device = open ("/dev/dsp", O_RDWR)) == -1){
|
||||
perror("/dev/dsp");
|
||||
return 0;
|
||||
}
|
||||
/* oss_device = open("/dev/dsp", "wb"); // /dev/dsp is the standard OSS output
|
||||
if(oss_device == NULL) // just get out if there's none
|
||||
return 0;
|
||||
|
||||
*/
|
||||
Cmd_AddCommand ("dumb", Tracker_f); // link DUMB
|
||||
Con_Printf("DUMB Initialized\n"); // Tell them we are ready
|
||||
return 1; // return that we have successfully initialised
|
||||
|
@ -194,6 +207,6 @@ int Tracker_Init(void)
|
|||
void Tracker_Shutdown(void)
|
||||
{
|
||||
Tracker_Stop(); // First stop the track
|
||||
fclose(oss_device); // Close the device
|
||||
close(oss_device); // Close the device
|
||||
dumb_exit(); // Kill DUMB
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue