Fixed .rtlight parsing.
This commit is contained in:
parent
53519b8512
commit
82f47c0d0d
6 changed files with 29 additions and 147 deletions
|
@ -2158,7 +2158,11 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
|
|||
break;
|
||||
|
||||
case MENU_MIDI_VOLUME:
|
||||
#ifndef linux
|
||||
M_Print (16, y, " MIDI Music Volume");
|
||||
#else
|
||||
M_Print (16, y, " Tracker Volume");
|
||||
#endif
|
||||
r = midivolume->value;
|
||||
M_DrawSlider (220, y, r);
|
||||
y += 8;
|
||||
|
|
|
@ -294,39 +294,27 @@ void R_LoadRTLights(void)
|
|||
org[1] = atof(com_token);
|
||||
file->data = COM_Parse(file->data);
|
||||
org[2] = atof(com_token);
|
||||
|
||||
file->data = COM_Parse(file->data);
|
||||
radius = atof(com_token);
|
||||
|
||||
file->data = COM_Parse(file->data);
|
||||
rgb[0] = atof(com_token);
|
||||
file->data = COM_Parse(file->data);
|
||||
rgb[1] = atof(com_token);
|
||||
file->data = COM_Parse(file->data);
|
||||
rgb[2] = atof(com_token);
|
||||
//R_LightsHere(org,666, rgb);
|
||||
file->data = COM_Parse(file->data);
|
||||
style = atoi(com_token);
|
||||
|
||||
file->data = COM_Parse(file->data);
|
||||
style = atof(com_token);
|
||||
|
||||
style = atoi(com_token);
|
||||
file->data = COM_Parse(file->data);
|
||||
corona = atof(com_token);
|
||||
|
||||
// We got a corona, so let's make it happen.
|
||||
if (corona){
|
||||
//Con_Printf("we got a %f %f %f %f %f %f %f %i %f %f in here\n", org[0], org[1], org[2], radius, rgb[0], rgb[1], rgb[2], style, style, corona);
|
||||
R_FlareTest(org,11,(int)rgb[0] * 255,(int)rgb[1] * 255,(int)rgb[2] * 255,0,NULL);
|
||||
|
||||
// R_LightsHere(org, radius, rgb);
|
||||
Con_Printf("we got a %f %f %f %f %f %f %f %i %i %f in here\n",
|
||||
org[0], org[1], org[2], radius, rgb[0], rgb[1], rgb[2], style, style, corona);
|
||||
R_FlareTest(org,11,(int)(rgb[0] * 255),(int)(rgb[1] * 255),(int)(rgb[2] * 255),0,NULL);
|
||||
}
|
||||
// testing the wlights using rtlight data. I want to really load the entities list.
|
||||
{
|
||||
// if (radius){
|
||||
|
||||
|
||||
}
|
||||
file->data = end+1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3795,25 +3795,6 @@ void R_GenTile (msurface_t *psurf, void *pdest)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
R_BuildSurfaceDisplayList
|
||||
|
|
|
@ -211,38 +211,6 @@ qboolean SNDDMA_InitOSS (void)
|
|||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
/* if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps) == -1)
|
||||
{
|
||||
perror (snd_dev);
|
||||
errstr = "Cannot determine capabilities of soundcard\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
if (!(caps & DSP_CAP_TRIGGER) || !(caps & DSP_CAP_MMAP))
|
||||
{
|
||||
errstr = "Soundcard doesn't support necessary features\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
*/
|
||||
/* if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1)
|
||||
{
|
||||
perror ("GETOSPACE");
|
||||
errstr = "Um, can't do GETOSPACE?\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
shm = &sn;
|
||||
shm->splitbuffer = 0;
|
||||
*/
|
||||
// set sample bits & speed
|
||||
/* if ((s = getenv("QUAKE_SOUND_SAMPLEBITS")))
|
||||
shm->samplebits = Q_atoi(s);
|
||||
else if ((i = COM_CheckParm("-sndbits")) && (i + 1 < com_argc))
|
||||
shm->samplebits = Q_atoi(com_argv[i+1]);
|
||||
else
|
||||
shm->samplebits = 0;
|
||||
*/
|
||||
if (shm->samplebits != 16 && shm->samplebits != 8)
|
||||
{
|
||||
ioctl (audio_fd, SNDCTL_DSP_GETFMTS, &fmt);
|
||||
|
@ -265,18 +233,7 @@ qboolean SNDDMA_InitOSS (void)
|
|||
errstr = va ("Soundcard does not support %d-bit data.\n", shm->samplebits);
|
||||
goto SNDFAIL;
|
||||
}
|
||||
/*
|
||||
if ((s = getenv("QUAKE_SOUND_SPEED")))
|
||||
shm->speed = Q_atoi(s);
|
||||
else if ((i = COM_CheckParm("-sndspeed")) && (i + 1 < com_argc))
|
||||
shm->speed = Q_atoi(com_argv[i+1]);
|
||||
else if (COM_CheckParm("-44khz"))
|
||||
shm->speed = 44100;
|
||||
else if (COM_CheckParm("-22khz"))
|
||||
shm->speed = 22050;
|
||||
else
|
||||
shm->speed = 0;
|
||||
*/
|
||||
|
||||
if (shm->speed == 0)
|
||||
{
|
||||
for (i=0 ; i<sizeof(tryrates)/4 ; i++)
|
||||
|
@ -307,15 +264,7 @@ qboolean SNDDMA_InitOSS (void)
|
|||
shm->speed = tmp;
|
||||
|
||||
SET_CHANNELS:
|
||||
/* if ((s = getenv("QUAKE_SOUND_CHANNELS")))
|
||||
shm->channels = Q_atoi(s);
|
||||
else if ((i = COM_CheckParm("-sndmono")))
|
||||
shm->channels = 1;
|
||||
else if ((i = COM_CheckParm("-sndstereo")))
|
||||
shm->channels = 2;
|
||||
else
|
||||
shm->channels = 2;
|
||||
*/
|
||||
|
||||
tmp = shm->channels;
|
||||
rc = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &tmp);
|
||||
if (rc < 0)
|
||||
|
@ -326,52 +275,8 @@ SET_CHANNELS:
|
|||
}
|
||||
shm->channels = tmp;
|
||||
|
||||
/*
|
||||
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info) == -1)
|
||||
{
|
||||
perror ("GETOSPACE");
|
||||
errstr = "Um, can't do GETOSPACE?\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
shm->samples = info.fragstotal * info.fragsize / (shm->samplebits / 8);
|
||||
// shm->submission_chunk = 1;
|
||||
|
||||
// memory map the dma buffer
|
||||
shm->buffer = (unsigned char *)mmap (NULL, info.fragstotal * info.fragsize, PROT_WRITE, MAP_FILE|MAP_SHARED, audio_fd, 0);
|
||||
if (!shm->buffer || shm->buffer == (unsigned char *)MAP_FAILED)
|
||||
{
|
||||
perror (snd_dev);
|
||||
errstr = va("Could not mmap %s (error %d)\n", snd_dev, errno);
|
||||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
// toggle the trigger & start her up
|
||||
tmp = 0;
|
||||
rc = ioctl (audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
|
||||
if (rc < 0)
|
||||
{
|
||||
perror (snd_dev);
|
||||
errstr = "Could not toggle.\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
tmp = PCM_ENABLE_OUTPUT;
|
||||
rc = ioctl (audio_fd, SNDCTL_DSP_SETTRIGGER, &tmp);
|
||||
if (rc < 0)
|
||||
{
|
||||
perror (snd_dev);
|
||||
errstr = "Could not toggle.\n";
|
||||
goto SNDFAIL;
|
||||
}
|
||||
*/
|
||||
// shm->samplepos = 0;
|
||||
|
||||
if (!SNDDMA_InitOSS_Direct (&errstr))
|
||||
{
|
||||
// if (!SNDDMA_InitOSS_Indirect (&errstr))
|
||||
goto SNDFAIL;
|
||||
}
|
||||
|
||||
snd_inited = true;
|
||||
return true;
|
||||
|
@ -468,7 +373,7 @@ void SNDDMA_Shutdown (void)
|
|||
{
|
||||
if (snd_inited)
|
||||
{
|
||||
ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); // fixes hang when using aoss
|
||||
ioctl(audio_fd, SNDCTL_DSP_RESET, NULL); // fixes hang when using aoss
|
||||
close (audio_fd);
|
||||
audio_fd = 0;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#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
|
||||
|
@ -42,11 +43,12 @@ static int depth = 16; // by default 16bit, only affects output not internal
|
|||
static int unsign = 0;
|
||||
static int freq = 22050;// 22050 is enough for most music
|
||||
static int n_channels = 2; // stereo action
|
||||
static float cdvolume = 0.8f; // default cdvolume...?
|
||||
static float trackervolume = 1.0f; // default volume...?
|
||||
static float delay = 0.0f; // You shouldn't need to touch this.
|
||||
static float delta; // For the speed, combination of frequency
|
||||
static int bufsize;
|
||||
static qboolean playing = false;// Is the music playing or not?
|
||||
extern cvar_t *midivolume;
|
||||
|
||||
union {
|
||||
short s16[2048]; // was 8192
|
||||
|
@ -140,12 +142,6 @@ static void Tracker_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "volume") == 0)
|
||||
{
|
||||
cdvolume = (float)Q_atoi(Cmd_Argv (2));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Q_strcasecmp(command, "frequency") == 0)
|
||||
{
|
||||
freq = (int)Q_atoi(Cmd_Argv (2));
|
||||
|
@ -175,8 +171,11 @@ void Tracker_Update(void)
|
|||
if(playing == false)
|
||||
return;
|
||||
|
||||
if (midivolume->value != trackervolume)
|
||||
trackervolume = midivolume->value;
|
||||
|
||||
// Render the song
|
||||
int l = duh_render(sr, depth, unsign, cdvolume, delta, bufsize, &buffer);
|
||||
int l = duh_render(sr, depth, unsign, trackervolume, delta, bufsize, &buffer);
|
||||
if (depth == 16) { // On 16 bit, fill the buffer accordingly
|
||||
for (i = 0; i < l * n_channels; i++) {
|
||||
short val = buffer.s16[i];
|
||||
|
@ -191,14 +190,11 @@ void Tracker_Update(void)
|
|||
|
||||
int Tracker_Init(void)
|
||||
{
|
||||
if((oss_device = open ("/dev/dsp", O_RDWR)) == -1){
|
||||
if((oss_device = open ("/dev/dsp", O_RDWR)) == -1){ // /dev/dsp is the standard OSS output
|
||||
perror("/dev/dsp");
|
||||
return 0;
|
||||
return 0; // just get out if there's none
|
||||
}
|
||||
/* 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
|
||||
|
|
|
@ -58,6 +58,7 @@ int p_mouse_y;
|
|||
int ignorenext;
|
||||
int bits_per_pixel;
|
||||
extern int deathcam_yesiamdead; // eukara - deathcam
|
||||
extern int reflectavailable;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -659,6 +660,13 @@ void VID_Init (unsigned char *palette)
|
|||
// map the window
|
||||
XMapWindow(x_disp, x_win);
|
||||
|
||||
// eukara - water reflection
|
||||
#ifdef WATERREFLECTIONS
|
||||
vid.reflectbuffer = (unsigned char *) malloc (vid.width * vid.height);
|
||||
memset (vid.reflectbuffer, 0xff, vid.width * vid.height);
|
||||
reflectavailable = 1;
|
||||
#endif
|
||||
|
||||
// wait for first exposure event
|
||||
{
|
||||
XEvent event;
|
||||
|
|
Loading…
Reference in a new issue