[prboom+] 02/05: Imported Upstream version 2.5.1.4~svn4425+dfsg1
Fabian Greffrath
fabian-guest at moszumanska.debian.org
Thu Apr 30 13:17:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
fabian-guest pushed a commit to branch master
in repository prboom+.
commit c7884cb7e19a8f7540e436734b32024364533dd2
Author: Fabian Greffrath <fabian+debian at greffrath.com>
Date: Thu Mar 26 13:51:38 2015 +0100
Imported Upstream version 2.5.1.4~svn4425+dfsg1
---
data/lumps/glfp.lmp | 3 ++-
src/MUSIC/flplayer.c | 3 +++
src/SDL/i_sound.c | 2 ++
src/am_map.c | 8 +++----
src/i_sound.h | 2 ++
src/m_misc.c | 2 ++
src/r_main.c | 4 ++--
src/r_main.h | 2 +-
src/r_plane.c | 64 +++++++++++-----------------------------------------
src/r_segs.c | 26 ++++++++++-----------
src/r_things.c | 6 ++---
11 files changed, 47 insertions(+), 75 deletions(-)
diff --git a/data/lumps/glfp.lmp b/data/lumps/glfp.lmp
index 888d14b..f76efd2 100644
--- a/data/lumps/glfp.lmp
+++ b/data/lumps/glfp.lmp
@@ -10,7 +10,8 @@ void main()
// Doom lighting equation ripped from EDGE.
float L = 63.0 * lightlevel;
float min_L = clamp(36.0 - L, 0.0, 31.0);
- float index = 59.0 + DOOMLIGHTFACTOR - L - DOOMLIGHTFACTOR / gl_FragCoord.z;
+ float dist = max(0.0, gl_FragCoord.z);
+ float index = 59.0 + DOOMLIGHTFACTOR - L - DOOMLIGHTFACTOR / dist;
color.rgb *= (1.0 - clamp(index, min_L, 31.0) / 31.0);
gl_FragColor = color * texture2D(tex, gl_TexCoord[0].st);
diff --git a/src/MUSIC/flplayer.c b/src/MUSIC/flplayer.c
index 7b05ca6..c356db9 100644
--- a/src/MUSIC/flplayer.c
+++ b/src/MUSIC/flplayer.c
@@ -148,6 +148,9 @@ static int fl_init (int samplerate)
FSET (num, "synth.sample-rate", f_soundrate);
+ FSET (int, "synth.chorus.active", mus_fluidsynth_chorus);
+ FSET (int, "synth.reverb.active", mus_fluidsynth_reverb);
+
// gain control
FSET (num, "synth.gain", mus_fluidsynth_gain / 100.0); // 0.0 - 0.2 - 10.0
// behavior wrt bank select messages
diff --git a/src/SDL/i_sound.c b/src/SDL/i_sound.c
index 2ba9a8f..41a08f4 100644
--- a/src/SDL/i_sound.c
+++ b/src/SDL/i_sound.c
@@ -1260,6 +1260,8 @@ static const void *music_handle = NULL;
// won't have this
static void *song_data = NULL;
+int mus_fluidsynth_chorus;
+int mus_fluidsynth_reverb;
int mus_fluidsynth_gain; // NSM fine tune fluidsynth output level
int mus_opl_gain; // NSM fine tune OPL output level
diff --git a/src/am_map.c b/src/am_map.c
index 0138a01..79572eb 100644
--- a/src/am_map.c
+++ b/src/am_map.c
@@ -1225,8 +1225,8 @@ static void AM_drawGrid(int color)
// Figure out start of vertical gridlines
start = minx - extx;
- if ((start - bmaporgx) % gridsize)
- start -= ((start - bmaporgx) % gridsize);
+ if ((start - (bmaporgx>>FRACTOMAPBITS)) % gridsize)
+ start -= ((start - (bmaporgx>>FRACTOMAPBITS)) % gridsize);
end = minx + minlen - extx;
// draw vertical gridlines
@@ -1251,8 +1251,8 @@ static void AM_drawGrid(int color)
// Figure out start of horizontal gridlines
start = miny - exty;
- if ((start - bmaporgy) % gridsize)
- start -= ((start - bmaporgy) % gridsize);
+ if ((start - (bmaporgy>>FRACTOMAPBITS)) % gridsize)
+ start -= ((start - (bmaporgy>>FRACTOMAPBITS)) % gridsize);
end = miny + minlen - exty;
// draw horizontal gridlines
diff --git a/src/i_sound.h b/src/i_sound.h
index 7768d5e..5cf0fb2 100644
--- a/src/i_sound.h
+++ b/src/i_sound.h
@@ -133,6 +133,8 @@ extern int snd_samplerate;
extern int use_experimental_music;
+extern int mus_fluidsynth_chorus;
+extern int mus_fluidsynth_reverb;
extern int mus_fluidsynth_gain; // NSM fine tune fluidsynth output level
extern int mus_opl_gain; // NSM fine tune OPL output level
diff --git a/src/m_misc.c b/src/m_misc.c
index f83bf8f..2d15718 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -389,6 +389,8 @@ default_t defaults[] =
{"mus_extend_volume",{&mus_extend_volume},{0},0,1,
def_bool,ss_none}, // e6y: apply midi volume to all midi devices
#endif
+ {"mus_fluidsynth_chorus",{&mus_fluidsynth_chorus},{1},0,1,def_bool,ss_none},
+ {"mus_fluidsynth_reverb",{&mus_fluidsynth_reverb},{1},0,1,def_bool,ss_none},
{"mus_fluidsynth_gain",{&mus_fluidsynth_gain},{50},0,1000,def_int,ss_none}, // NSM fine tune fluidsynth output level
{"mus_opl_gain",{&mus_opl_gain},{50},0,1000,def_int,ss_none}, // NSM fine tune opl output level
diff --git a/src/r_main.c b/src/r_main.c
index a2165e9..f38da14 100644
--- a/src/r_main.c
+++ b/src/r_main.c
@@ -106,7 +106,7 @@ angle_t viewangle;
fixed_t viewcos, viewsin;
player_t *viewplayer;
// e6y: Added for more precise flats drawing
-float viewfocratio;
+fixed_t viewfocratio;
int r_nearclip = 5;
@@ -836,7 +836,7 @@ void R_ExecuteSetViewSize (void)
// calculate projectiony using int_64_t math to avoid overflow when SCREENWIDTH>4228
projectiony = (fixed_t)((((int_64_t)cheight * centerx * 320) / 200) / SCREENWIDTH * FRACUNIT);
// e6y: this is a precalculated value for more precise flats drawing (see R_MapPlane)
- viewfocratio = (1.6f * centerx / wide_centerx) / ((float)SCREENWIDTH / (float)cheight);
+ viewfocratio = projectiony / wide_centerx;
R_SetupViewScaling();
diff --git a/src/r_main.h b/src/r_main.h
index 311a4f3..56d2423 100644
--- a/src/r_main.h
+++ b/src/r_main.h
@@ -72,7 +72,7 @@ extern int wide_offset2y;
extern fixed_t projectiony;
extern int validcount;
// e6y: Added for more precise flats drawing
-extern float viewfocratio;
+extern fixed_t viewfocratio;
//
// Rendering stats
diff --git a/src/r_plane.c b/src/r_plane.c
index 19b3bed..c100815 100644
--- a/src/r_plane.c
+++ b/src/r_plane.c
@@ -104,9 +104,6 @@ static fixed_t planeheight;
static fixed_t basexscale, baseyscale;
static fixed_t *cachedheight = NULL;
-static fixed_t *cacheddistance = NULL;
-static fixed_t *cachedxstep = NULL;
-static fixed_t *cachedystep = NULL;
static fixed_t xoffs,yoffs; // killough 2/28/98: flat offsets
// e6y: resolution limitation is removed
@@ -120,9 +117,6 @@ void R_InitPlanesRes(void)
if (spanstart) free(spanstart);
if (cachedheight) free(cachedheight);
- if (cacheddistance) free(cacheddistance);
- if (cachedxstep) free(cachedxstep);
- if (cachedystep) free(cachedystep);
if (yslope) free(yslope);
if (distscale) free(distscale);
@@ -132,9 +126,6 @@ void R_InitPlanesRes(void)
spanstart = calloc(1, SCREENHEIGHT * sizeof(*spanstart));
cachedheight = calloc(1, SCREENHEIGHT * sizeof(*cachedheight));
- cacheddistance = calloc(1, SCREENHEIGHT * sizeof(*cacheddistance));
- cachedxstep = calloc(1, SCREENHEIGHT * sizeof(*cachedxstep));
- cachedystep = calloc(1, SCREENHEIGHT * sizeof(*cachedystep));
yslope = calloc(1, SCREENHEIGHT * sizeof(*yslope));
distscale = calloc(1, SCREENWIDTH * sizeof(*distscale));
@@ -179,8 +170,8 @@ void R_InitPlanes (void)
static void R_MapPlane(int y, int x1, int x2, draw_span_vars_t *dsvars)
{
- angle_t angle;
- fixed_t distance, length;
+ int_64_t den;
+ fixed_t distance;
unsigned index;
#ifdef RANGECHECK
@@ -188,8 +179,6 @@ static void R_MapPlane(int y, int x1, int x2, draw_span_vars_t *dsvars)
I_Error ("R_MapPlane: %i, %i at %i",x1,x2,y);
#endif
- // e6y
- //
// [RH]Instead of using the xtoviewangle array, I calculated the fractional values
// at the middle of the screen, then used the calculated ds_xstep and ds_ystep
// to step from those to the proper texture coordinate to start drawing at.
@@ -199,45 +188,18 @@ static void R_MapPlane(int y, int x1, int x2, draw_span_vars_t *dsvars)
// Visplanes with the same texture now match up far better than before.
//
// See cchest2.wad/map02/room with sector #265
+ if (centery == y)
+ return;
+ den = (int_64_t)FRACUNIT * FRACUNIT * D_abs(centery - y);
+ distance = FixedMul (planeheight, yslope[y]);
+
+ dsvars->xstep = (fixed_t)((int_64_t)viewsin * planeheight * viewfocratio / den);
+ dsvars->ystep = (fixed_t)((int_64_t)viewcos * planeheight * viewfocratio / den);
- if (!render_precise)
- {
- if (planeheight != cachedheight[y])
- {
- cachedheight[y] = planeheight;
- distance = cacheddistance[y] = FixedMul (planeheight, yslope[y]);
- dsvars->xstep = cachedxstep[y] = FixedMul (distance,basexscale);
- dsvars->ystep = cachedystep[y] = FixedMul (distance,baseyscale);
- }
- else
- {
- distance = cacheddistance[y];
- dsvars->xstep = cachedxstep[y];
- dsvars->ystep = cachedystep[y];
- }
-
- length = FixedMul (distance,distscale[x1]);
- angle = (viewangle + xtoviewangle[x1])>>ANGLETOFINESHIFT;
-
- // killough 2/28/98: Add offsets
- dsvars->xfrac = viewx + FixedMul(finecosine[angle], length) + xoffs;
- dsvars->yfrac = -viewy - FixedMul(finesine[angle], length) + yoffs;
- }
- else
- {
- float slope, realy;
-
- distance = FixedMul (planeheight, yslope[y]);
- slope = (float)(planeheight / 65535.0f / D_abs(centery - y));
- realy = (float)distance / 65536.0f;
-
- dsvars->xstep = (fixed_t)(viewsin * slope * viewfocratio);
- dsvars->ystep = (fixed_t)(viewcos * slope * viewfocratio);
-
- dsvars->xfrac = viewx + xoffs + (int)(viewcos * realy) + (x1 - centerx) * dsvars->xstep;
- dsvars->yfrac = -viewy + yoffs - (int)(viewsin * realy) + (x1 - centerx) * dsvars->ystep;
- }
-
+ // killough 2/28/98: Add offsets
+ dsvars->xfrac = viewx + xoffs + FixedMul(viewcos, distance) + (x1 - centerx) * dsvars->xstep;
+ dsvars->yfrac = -viewy + yoffs - FixedMul(viewsin, distance) + (x1 - centerx) * dsvars->ystep;
+
if (drawvars.filterfloor == RDRAW_FILTER_LINEAR) {
dsvars->xfrac -= (FRACUNIT>>1);
dsvars->yfrac -= (FRACUNIT>>1);
diff --git a/src/r_segs.c b/src/r_segs.c
index ba5df64..5718192 100644
--- a/src/r_segs.c
+++ b/src/r_segs.c
@@ -88,13 +88,13 @@ static int worldtop;
static int worldbottom;
static int worldhigh;
static int worldlow;
-static fixed_t pixhigh;
-static fixed_t pixlow;
+static int_64_t pixhigh; // R_WiggleFix
+static int_64_t pixlow; // R_WiggleFix
static fixed_t pixhighstep;
static fixed_t pixlowstep;
-static fixed_t topfrac;
+static int_64_t topfrac; // R_WiggleFix
static fixed_t topstep;
-static fixed_t bottomfrac;
+static int_64_t bottomfrac; // R_WiggleFix
static fixed_t bottomstep;
static int *maskedtexturecol; // dropoff overflow
@@ -365,7 +365,7 @@ void R_RenderMaskedSegRange(drawseg_t *ds, int x1, int x2)
if (t + (int_64_t) textureheight[texnum] * spryscale < 0 ||
t > (int_64_t) SCREENHEIGHT << FRACBITS*2)
continue; // skip if the texture is out of screen's range
- sprtopscreen = (int_64_t)(t >> FRACBITS);
+ sprtopscreen = (int_64_t)(t >> FRACBITS); // R_WiggleFix
}
dcvars.iscale = 0xffffffffu / (unsigned) spryscale;
@@ -424,8 +424,8 @@ static void R_RenderSegLoop (void)
// mark floor / ceiling areas
- int yh = bottomfrac>>HEIGHTBITS;
- int yl = (topfrac+HEIGHTUNIT-1)>>HEIGHTBITS;
+ int yh = (int)(bottomfrac>>HEIGHTBITS);
+ int yl = (int)((topfrac+HEIGHTUNIT-1)>>HEIGHTBITS);
// no space above wall?
int bottom,top = ceilingclip[rw_x]+1;
@@ -528,7 +528,7 @@ static void R_RenderSegLoop (void)
if (toptexture)
{
// top wall
- int mid = pixhigh>>HEIGHTBITS;
+ int mid = (int)(pixhigh>>HEIGHTBITS);
pixhigh += pixhighstep;
if (mid >= floorclip[rw_x])
@@ -562,7 +562,7 @@ static void R_RenderSegLoop (void)
if (bottomtexture) // bottom wall
{
- int mid = (pixlow+HEIGHTUNIT-1)>>HEIGHTBITS;
+ int mid = (int)((pixlow+HEIGHTUNIT-1)>>HEIGHTBITS);
pixlow += pixlowstep;
// no space above wall?
@@ -948,10 +948,10 @@ void R_StoreWallRange(const int start, const int stop)
worldbottom >>= invhgtbits;
topstep = -FixedMul (rw_scalestep, worldtop);
- topfrac = (centeryfrac>>invhgtbits) - FixedMul (worldtop, rw_scale);
+ topfrac = ((int_64_t)centeryfrac>>invhgtbits) - (((int_64_t)worldtop*rw_scale)>>FRACBITS); // R_WiggleFix
bottomstep = -FixedMul (rw_scalestep,worldbottom);
- bottomfrac = (centeryfrac>>invhgtbits) - FixedMul (worldbottom, rw_scale);
+ bottomfrac = ((int_64_t)centeryfrac>>invhgtbits) - (((int_64_t)worldbottom*rw_scale)>>FRACBITS); // R_WiggleFix
if (backsector)
{
@@ -960,12 +960,12 @@ void R_StoreWallRange(const int start, const int stop)
if (worldhigh < worldtop)
{
- pixhigh = (centeryfrac>>invhgtbits) - FixedMul (worldhigh, rw_scale);
+ pixhigh = ((int_64_t)centeryfrac>>invhgtbits) - (((int_64_t)worldhigh*rw_scale)>>FRACBITS); // R_WiggleFix
pixhighstep = -FixedMul (rw_scalestep,worldhigh);
}
if (worldlow > worldbottom)
{
- pixlow = (centeryfrac>>invhgtbits) - FixedMul (worldlow, rw_scale);
+ pixlow = ((int_64_t)centeryfrac>>invhgtbits) - (((int_64_t)worldlow*rw_scale)>>FRACBITS); // R_WiggleFix
pixlowstep = -FixedMul (rw_scalestep,worldlow);
}
}
diff --git a/src/r_things.c b/src/r_things.c
index f900a3e..f90c266 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -441,7 +441,7 @@ static vissprite_t *R_NewVisSprite(void)
int *mfloorclip; // dropoff overflow
int *mceilingclip; // dropoff overflow
fixed_t spryscale;
-int_64_t sprtopscreen;
+int_64_t sprtopscreen; // R_WiggleFix
void R_DrawMaskedColumn(
const rpatch_t *patch,
@@ -453,8 +453,8 @@ void R_DrawMaskedColumn(
)
{
int i;
- int_64_t topscreen;
- int_64_t bottomscreen;
+ int_64_t topscreen; // R_WiggleFix
+ int_64_t bottomscreen; // R_WiggleFix
fixed_t basetexturemid = dcvars->texturemid;
dcvars->texheight = patch->height; // killough 11/98
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/prboom+.git
More information about the Pkg-games-commits
mailing list