Mostly stuff from JonoF

git-svn-id: https://svn.eduke32.com/eduke32@212 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-07-06 06:18:18 +00:00
parent e9aca89385
commit 621da0a840
4 changed files with 460 additions and 503 deletions

View file

@ -75,10 +75,10 @@ long usemodels=1, usehightile=1;
float fogtable[] = { 0.275, 0.325, 0.375, 0.425, 0.475, 0.525, 0.575, 0.625, 0.675, 0.725, 0.775, 0.825, 0.875, 0.925, 0.975, 1.025, 1.075, 1.125, 1.175, 1.225, 1.275, 1.325, 1.375, 1.425, 1.475, 1.525, 1.575, 1.625, 1.675, 1.725, 1.775, 1.825 };
#define NEGFOGSUB 0.08
#define NEGFOGTABLESCALE 8
#define FOGTABLESCALE 2
#define SPRFOGTABLESCALE 1.5
#define NEGFOGSUB 0.075
#define NEGFOGTABLESCALE 6.670
#define FOGTABLESCALE 1.900
#define SPRFOGTABLESCALE 1.700
#include <math.h> //<-important!
typedef struct { float x, cy[2], fy[2]; long n, p, tag, ctag, ftag; } vsptyp;

View file

@ -47,11 +47,14 @@ typedef uint64 uint64_t;
#define SOUNDM_PLAYER 128
#define UNITSPERMETRE 1024.0
#define DEFAULTREFDIST 6.5 // in the original code, ((255-150)<<6) == 6720
#define DEFAULTMAXDIST 30.0 // in the original code, 31444
#define DEFAULTREFDIST (6720.0/1024.0) // in the original code, ((255-150)<<6) == 6720
#define DEFAULTMAXDIST (31444.0/1024.0) // in the original code, 31444
#define DEFAULTROLLOFF 1.0//0.75
#define OCCLUDEDFACTOR 0.8
static JFAudMixerChannel::Filter DefaultFilter = JFAudMixerChannel::FilterNearest;
static int osdcmd_setsoundfilter(const osdfuncparm_t *parm);
#include <cmath>
class KenFile : public JFAudFile {
@ -229,6 +232,8 @@ void SoundStartup(void)
}
if (jfaud->InitMIDI(NULL)) havemidi = true;
OSD_RegisterFunction("setsoundfilter","setsoundfilter: 0=nearest 1=linear 2=4point",osdcmd_setsoundfilter);
}
void SoundShutdown(void)
@ -426,7 +431,8 @@ int xyzsound(short num, short i, long x, long y, long z)
if (soundm[num] & SOUNDM_GLOBAL) global = 1;
chan->SetRefDist(refdist);
chan->SetMaxDist(maxdist);
chan->SetFilter((soundm[num]&SOUNDM_NICE) ? JFAudMixerChannel::Filter4Point : JFAudMixerChannel::FilterNearest);
chan->SetFilter((soundm[num]&SOUNDM_NICE) ? JFAudMixerChannel::Filter4Point : DefaultFilter);
chan->SetDistanceModel(JFAudMixerChannel::DistanceModelLinear);
if (PN == APLAYER && sprite[i].yvel == screenpeek) {
chan->SetRolloff(0.0);
@ -437,8 +443,6 @@ int xyzsound(short num, short i, long x, long y, long z)
chan->SetFollowListener(false);
chan->SetPosition((float)x/UNITSPERMETRE, (float)(-z>>4)/UNITSPERMETRE, (float)y/UNITSPERMETRE);
}
initprintf("%d gain=%g ptch=%g loop=%d glob=%d refd=%g maxd=%g\n",num,gain,pitch,
(soundm[num] & SOUNDM_LOOP) == SOUNDM_LOOP, global, refdist, maxdist);
r = keephandle(chan, num, i);
if (r >= 0) chan->SetStopCallback(stopcallback, r);
chan->Play();
@ -478,7 +482,8 @@ void sound(short num)
chan->SetRefDist(DEFAULTREFDIST);
chan->SetFollowListener(true);
chan->SetPosition(0.0, 0.0, 0.0);
chan->SetFilter((soundm[num]&SOUNDM_NICE) ? JFAudMixerChannel::Filter4Point : JFAudMixerChannel::FilterNearest);
chan->SetFilter((soundm[num]&SOUNDM_NICE) ? JFAudMixerChannel::Filter4Point : DefaultFilter);
chan->SetDistanceModel(JFAudMixerChannel::DistanceModelLinear);
r = keephandle(chan, num, -1);
if (r >= 0) chan->SetStopCallback(stopcallback, r);
@ -710,3 +715,14 @@ void MUSIC_RegisterTimbreBank( unsigned char *timbres )
{
}
static int osdcmd_setsoundfilter(const osdfuncparm_t *parm)
{
int filt = 0;
if (parm->numparms < 1) return OSDCMD_SHOWHELP;
filt = Batol(parm->parms[0]);
if (filt < JFAudMixerChannel::FilterNearest) filt = JFAudMixerChannel::FilterNearest;
else if (filt > JFAudMixerChannel::Filter4Point) filt = JFAudMixerChannel::Filter4Point;
DefaultFilter = (JFAudMixerChannel::Filter)filt;
return OSDCMD_OK;
}

View file

@ -158,29 +158,6 @@
</packing>
</child>
<child>
<widget class="GtkLabel" id="cddrvlabel">
<property name="width_request">88</property>
<property name="height_request">29</property>
<property name="visible">True</property>
<property name="label" translatable="yes">C_D drive:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">cddrvcombo</property>
</widget>
<packing>
<property name="x">0</property>
<property name="y">72</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="sounddrvcombo">
<property name="width_request">31</property>
@ -195,19 +172,6 @@
</packing>
</child>
<child>
<widget class="GtkComboBox" id="cddrvcombo">
<property name="width_request">31</property>
<property name="height_request">30</property>
<property name="visible">True</property>
<signal name="changed" handler="on_cddrvcombo_changed" last_modification_time="Fri, 30 Jun 2006 17:57:23 GMT"/>
</widget>
<packing>
<property name="x">88</property>
<property name="y">72</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="inputmousecheck">
<property name="width_request">80</property>

File diff suppressed because it is too large Load diff