This commit is contained in:
Christoph Oelckers 2016-11-08 14:31:10 +01:00
commit 5c7affd102
13 changed files with 387 additions and 522 deletions

View file

@ -291,6 +291,19 @@ if( NOT NO_FMOD )
if( EXISTS "${FMOD_INCLUDE_DIR}/fmod_common.h" ) if( EXISTS "${FMOD_INCLUDE_DIR}/fmod_common.h" )
set( FMOD_STUDIO YES ) set( FMOD_STUDIO YES )
set( FMOD_VERSION_FILE "fmod_common.h" )
else()
set( FMOD_STUDIO NO )
set( FMOD_VERSION_FILE "fmod.h" )
endif()
file( STRINGS "${FMOD_INCLUDE_DIR}/${FMOD_VERSION_FILE}" FMOD_VERSION_LINE REGEX "^#define[ \t]+FMOD_VERSION[ \t]+0x[0-9]+$" )
string( REGEX REPLACE "^#define[ \t]+FMOD_VERSION[ \t]+0x([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$" "\\1.\\2.\\3" FMOD_VERSION "${FMOD_VERSION_LINE}" )
message( STATUS "FMOD version: ${FMOD_VERSION}" )
# FMOD Ex didn't hide xiph symbols in the past (not applicable to Win32 since symbols are hidden by default there).
if( NOT WIN32 AND NOT FMOD_STUDIO AND NOT NO_OPENAL AND "${FMOD_VERSION}" VERSION_LESS "4.36.00")
message( SEND_ERROR "Use of FMOD Ex ${FMOD_VERSION} with OpenAL will result in crashes. Either update FMOD to 4.36 or later or set NO_OPENAL." )
endif() endif()
else() else()
message( STATUS "Could not find FMOD include files" ) message( STATUS "Could not find FMOD include files" )

View file

@ -2046,7 +2046,8 @@ void AM_drawSubsectors()
scale / scaley, scale / scaley,
rotation, rotation,
colormap, colormap,
floorlight floorlight,
f_y + f_h
); );
} }
} }

View file

@ -358,7 +358,7 @@ void DBot::WhatToGet (AActor *item)
} }
else if ((typeis (Megasphere) || typeis (Soulsphere) || typeis (HealthBonus)) && player->mo->health >= deh.MaxSoulsphere) else if ((typeis (Megasphere) || typeis (Soulsphere) || typeis (HealthBonus)) && player->mo->health >= deh.MaxSoulsphere)
return; return;
else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= deh.MaxHealth /*MAXHEALTH*/) else if (item->IsKindOf (RUNTIME_CLASS(AHealth)) && player->mo->health >= player->mo->GetMaxHealth() + player->mo->stamina)
return; return;
if ((dest == NULL || if ((dest == NULL ||

View file

@ -1172,7 +1172,7 @@ void G_Ticker ()
} }
// check for turbo cheats // check for turbo cheats
if (cmd->ucmd.forwardmove > TURBOTHRESHOLD && if (turbo > 100.f && cmd->ucmd.forwardmove > TURBOTHRESHOLD &&
!(gametic&31) && ((gametic>>5)&(MAXPLAYERS-1)) == i ) !(gametic&31) && ((gametic>>5)&(MAXPLAYERS-1)) == i )
{ {
Printf ("%s is turbo!\n", players[i].userinfo.GetName()); Printf ("%s is turbo!\n", players[i].userinfo.GetName());

View file

@ -241,7 +241,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
applyscale = false; applyscale = false;
} }
if(type == PLAYERICON) if(type == PLAYERICON)
texture = TexMan[statusBar->CPlayer->mo->ScoreIcon]; texture = TexMan(statusBar->CPlayer->mo->ScoreIcon);
else if(type == AMMO1) else if(type == AMMO1)
{ {
AAmmo *ammo = statusBar->ammo1; AAmmo *ammo = statusBar->ammo1;
@ -270,7 +270,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
{ {
AInventory *item = statusBar->CPlayer->mo->FindInventory<ASigil>(); AInventory *item = statusBar->CPlayer->mo->FindInventory<ASigil>();
if (item != NULL) if (item != NULL)
texture = TexMan[item->Icon]; texture = TexMan(item->Icon);
} }
else if(type == HEXENARMOR_ARMOR || type == HEXENARMOR_SHIELD || type == HEXENARMOR_HELM || type == HEXENARMOR_AMULET) else if(type == HEXENARMOR_ARMOR || type == HEXENARMOR_SHIELD || type == HEXENARMOR_HELM || type == HEXENARMOR_AMULET)
{ {
@ -290,7 +290,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
} }
} }
else if(type == INVENTORYICON) else if(type == INVENTORYICON)
texture = TexMan[sprite]; texture = TexMan(sprite);
else if(type == SELECTEDINVENTORYICON && statusBar->CPlayer->mo->InvSel != NULL) else if(type == SELECTEDINVENTORYICON && statusBar->CPlayer->mo->InvSel != NULL)
texture = TexMan(statusBar->CPlayer->mo->InvSel->Icon); texture = TexMan(statusBar->CPlayer->mo->InvSel->Icon);
else if(image >= 0) else if(image >= 0)
@ -312,7 +312,7 @@ class CommandDrawImage : public SBarInfoCommandFlowControl
spawnScaleY = item->Scale.Y; spawnScaleY = item->Scale.Y;
} }
texture = TexMan[icon]; texture = TexMan(icon);
} }
enum ImageType enum ImageType
@ -2436,22 +2436,22 @@ class CommandDrawKeyBar : public SBarInfoCommand
{ {
if(!vertical) if(!vertical)
{ {
statusBar->DrawGraphic(TexMan[item->Icon], x+slotOffset, y+rowOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets()); statusBar->DrawGraphic(TexMan(item->Icon), x+slotOffset, y+rowOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan[item->Icon]->GetScaledHeight()+2 : rowIconSize; rowWidth = rowIconSize == -1 ? TexMan(item->Icon)->GetScaledHeight()+2 : rowIconSize;
} }
else else
{ {
statusBar->DrawGraphic(TexMan[item->Icon], x+rowOffset, y+slotOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets()); statusBar->DrawGraphic(TexMan(item->Icon), x+rowOffset, y+slotOffset, block->XOffset(), block->YOffset(), block->Alpha(), block->FullScreenOffsets());
rowWidth = rowIconSize == -1 ? TexMan[item->Icon]->GetScaledWidth()+2 : rowIconSize; rowWidth = rowIconSize == -1 ? TexMan(item->Icon)->GetScaledWidth()+2 : rowIconSize;
} }
// If cmd.special is -1 then the slot size is auto detected // If cmd.special is -1 then the slot size is auto detected
if(iconSize == -1) if(iconSize == -1)
{ {
if(!vertical) if(!vertical)
slotOffset += (reverse ? -1 : 1) * (TexMan[item->Icon]->GetScaledWidth() + 2); slotOffset += (reverse ? -1 : 1) * (TexMan(item->Icon)->GetScaledWidth() + 2);
else else
slotOffset += (reverse ? -1 : 1) * (TexMan[item->Icon]->GetScaledHeight() + 2); slotOffset += (reverse ? -1 : 1) * (TexMan(item->Icon)->GetScaledHeight() + 2);
} }
else else
slotOffset += (reverse ? -iconSize : iconSize); slotOffset += (reverse ? -iconSize : iconSize);

View file

@ -671,6 +671,7 @@ public:
{ {
return FOptionMenuItem::MenuEvent(mkey, fromcontroller); return FOptionMenuItem::MenuEvent(mkey, fromcontroller);
} }
if (fabs(value) < FLT_EPSILON) value = 0;
SetSliderValue(clamp(value, mMin, mMax)); SetSliderValue(clamp(value, mMin, mMax));
S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE);
return true; return true;

View file

@ -2677,10 +2677,11 @@ void P_PlayerThink (player_t *player)
// Apply degeneration. // Apply degeneration.
if (dmflags2 & DF2_YES_DEGENERATION) if (dmflags2 & DF2_YES_DEGENERATION)
{ {
if ((level.time % TICRATE) == 0 && player->health > deh.MaxHealth) int maxhealth = player->mo->GetMaxHealth() + player->mo->stamina;
if ((level.time % TICRATE) == 0 && player->health > maxhealth)
{ {
if (player->health - 5 < deh.MaxHealth) if (player->health - 5 < maxhealth)
player->health = deh.MaxHealth; player->health = maxhealth;
else else
player->health--; player->health--;

View file

@ -1066,56 +1066,188 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
return; return;
} }
// prevlineasm1 is like vlineasm1 but skips the loop if only drawing one pixel struct WallscanSampler
inline fixed_t prevline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplce, const BYTE *bufplce, BYTE *dest)
{ {
dc_iscale = vince; WallscanSampler() { }
dc_colormap = colormap; WallscanSampler(int y1, float swal, double yrepeat, fixed_t xoffset, FTexture *texture, const BYTE*(*getcol)(FTexture *texture, int x));
uint32_t uv_pos;
uint32_t uv_step;
uint32_t uv_max;
const BYTE *source;
uint32_t height;
};
WallscanSampler::WallscanSampler(int y1, float swal, double yrepeat, fixed_t xoffset, FTexture *texture, const BYTE*(*getcol)(FTexture *texture, int x))
{
height = texture->GetHeight();
int uv_fracbits = 32 - texture->HeightBits;
if (uv_fracbits != 32)
{
uv_max = height << uv_fracbits;
// Find start uv in [0-base_height[ range.
// Not using xs_ToFixed because it rounds the result and we need something that always rounds down to stay within the range.
double uv_stepd = swal * yrepeat;
double v = (dc_texturemid + uv_stepd * (y1 - CenterY + 0.5)) / height;
v = v - floor(v);
v *= height;
v *= (1 << uv_fracbits);
uv_pos = (uint32_t)v;
uv_step = xs_ToFixed(uv_fracbits, uv_stepd);
if (uv_step == 0) // To prevent divide by zero elsewhere
uv_step = 1;
}
else
{ // Hack for one pixel tall textures
uv_pos = 0;
uv_step = 0;
uv_max = 1;
}
source = getcol(texture, xoffset >> FRACBITS);
}
// Draw a column with support for non-power-of-two ranges
void wallscan_drawcol1(int x, int y1, int y2, WallscanSampler &sampler, DWORD(*draw1column)())
{
if (sampler.uv_max == 0 || sampler.uv_step == 0) // power of two
{
int count = y2 - y1;
dc_source = sampler.source;
dc_dest = (ylookup[y1] + x) + dc_destorg;
dc_count = count; dc_count = count;
dc_texturefrac = vplce; dc_iscale = sampler.uv_step;
dc_source = bufplce; dc_texturefrac = sampler.uv_pos;
dc_dest = dest; draw1column();
return doprevline1 ();
uint64_t step64 = sampler.uv_step;
uint64_t pos64 = sampler.uv_pos;
sampler.uv_pos = (uint32_t)(pos64 + step64 * count);
}
else
{
uint32_t uv_pos = sampler.uv_pos;
uint32_t left = y2 - y1;
while (left > 0)
{
uint32_t available = sampler.uv_max - uv_pos;
uint32_t next_uv_wrap = available / sampler.uv_step;
if (available % sampler.uv_step != 0)
next_uv_wrap++;
uint32_t count = MIN(left, next_uv_wrap);
dc_source = sampler.source;
dc_dest = (ylookup[y1] + x) + dc_destorg;
dc_count = count;
dc_iscale = sampler.uv_step;
dc_texturefrac = uv_pos;
draw1column();
left -= count;
uv_pos += sampler.uv_step * count;
if (uv_pos >= sampler.uv_max)
uv_pos -= sampler.uv_max;
} }
void wallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, sampler.uv_pos = uv_pos;
double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x)) }
}
// Draw four columns with support for non-power-of-two ranges
void wallscan_drawcol4(int x, int y1, int y2, WallscanSampler *sampler, void(*draw4columns)())
{ {
int x, fracbits; if (sampler[0].uv_max == 0 || sampler[0].uv_step == 0) // power of two, no wrap handling needed
int y1ve[4], y2ve[4], u4, d4, z; {
char bad; int count = y2 - y1;
float light = rw_light - rw_lightstep; for (int i = 0; i < 4; i++)
SDWORD xoffset; {
BYTE *basecolormapdata; bufplce[i] = sampler[i].source;
double iscale; vplce[i] = sampler[i].uv_pos;
vince[i] = sampler[i].uv_step;
// This function also gets used to draw skies. Unlike BUILD, skies are uint64_t step64 = sampler[i].uv_step;
// drawn by visplane instead of by bunch, so these checks are invalid. uint64_t pos64 = sampler[i].uv_pos;
//if ((uwal[x1] > viewheight) && (uwal[x2] > viewheight)) return; sampler[i].uv_pos = (uint32_t)(pos64 + step64 * count);
//if ((dwal[x1] < 0) && (dwal[x2] < 0)) return; }
dc_dest = (ylookup[y1] + x) + dc_destorg;
dc_count = count;
draw4columns();
}
else
{
dc_dest = (ylookup[y1] + x) + dc_destorg;
for (int i = 0; i < 4; i++)
{
bufplce[i] = sampler[i].source;
}
uint32_t left = y2 - y1;
while (left > 0)
{
// Find which column wraps first
uint32_t count = left;
for (int i = 0; i < 4; i++)
{
uint32_t available = sampler[i].uv_max - sampler[i].uv_pos;
uint32_t next_uv_wrap = available / sampler[i].uv_step;
if (available % sampler[i].uv_step != 0)
next_uv_wrap++;
count = MIN(next_uv_wrap, count);
}
// Draw until that column wraps
for (int i = 0; i < 4; i++)
{
vplce[i] = sampler[i].uv_pos;
vince[i] = sampler[i].uv_step;
}
dc_count = count;
draw4columns();
// Wrap the uv position
for (int i = 0; i < 4; i++)
{
sampler[i].uv_pos += sampler[i].uv_step * count;
if (sampler[i].uv_pos >= sampler[i].uv_max)
sampler[i].uv_pos -= sampler[i].uv_max;
}
left -= count;
}
}
}
typedef DWORD(*Draw1ColumnFuncPtr)();
typedef void(*Draw4ColumnsFuncPtr)();
void wallscan_any(
int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat,
const BYTE *(*getcol)(FTexture *tex, int x),
void(setupwallscan(int bits, Draw1ColumnFuncPtr &draw1, Draw4ColumnsFuncPtr &draw2)))
{
if (rw_pic->UseType == FTexture::TEX_Null) if (rw_pic->UseType == FTexture::TEX_Null)
{
return; return;
}
//extern cycle_t WallScanCycles; fixed_t xoffset = rw_offset;
//clock (WallScanCycles);
rw_pic->GetHeight(); // Make sure texture size is loaded rw_pic->GetHeight(); // To ensure that rw_pic->HeightBits has been set
fracbits = 32 - rw_pic->HeightBits; int fracbits = 32 - rw_pic->HeightBits;
if (fracbits == 32) if (fracbits == 32)
{ // Hack for one pixel tall textures { // Hack for one pixel tall textures
fracbits = 0; fracbits = 0;
yrepeat = 0; yrepeat = 0;
dc_texturemid = 0; dc_texturemid = 0;
} }
setupvline(fracbits);
xoffset = rw_offset;
basecolormapdata = basecolormap->Maps;
x = x1; DWORD(*draw1column)();
//while ((umost[x] > dmost[x]) && (x < x2)) x++; void(*draw4columns)();
setupwallscan(fracbits, draw1column, draw4columns);
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0); bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
if (fixed) if (fixed)
@ -1126,130 +1258,177 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *l
palookupoffse[3] = dc_colormap; palookupoffse[3] = dc_colormap;
} }
for(; (x < x2) && (x & 3); ++x) if (fixedcolormap)
dc_colormap = fixedcolormap;
else
dc_colormap = basecolormap->Maps;
float light = rw_light;
// Calculate where 4 column alignment begins and ends:
int aligned_x1 = clamp((x1 + 3) / 4 * 4, x1, x2);
int aligned_x2 = clamp(x2 / 4 * 4, x1, x2);
// First unaligned columns:
for (int x = x1; x < aligned_x1; x++, light += rw_lightstep)
{ {
light += rw_lightstep; int y1 = uwal[x];
y1ve[0] = uwal[x];//max(uwal[x],umost[x]); int y2 = dwal[x];
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]); if (y2 <= y1)
if (y2ve[0] <= y1ve[0]) continue;
assert (y1ve[0] < viewheight);
assert (y2ve[0] <= viewheight);
if (!fixed)
{ // calculate lighting
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + x + dc_destorg;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
dovline1();
}
for(; x < x2-3; x += 4)
{
bad = 0;
for (z = 3; z>= 0; --z)
{
y1ve[z] = uwal[x+z];//max(uwal[x+z],umost[x+z]);
y2ve[z] = dwal[x+z];//min(dwal[x+z],dmost[x+z])-1;
if (y2ve[z] <= y1ve[z]) { bad += 1<<z; continue; }
assert (y1ve[z] < viewheight);
assert (y2ve[z] <= viewheight);
bufplce[z] = getcol (rw_pic, (lwal[x+z] + xoffset) >> FRACBITS);
iscale = swal[x + z] * yrepeat;
vince[z] = xs_ToFixed(fracbits, iscale);
vplce[z] = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[z] - CenterY + 0.5));
}
if (bad == 15)
{
light += rw_lightstep * 4;
continue; continue;
}
if (!fixed) if (!fixed)
dc_colormap = basecolormap->Maps + (GETPALOOKUP(light, wallshade) << COLORMAPSHIFT);
WallscanSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, rw_pic, getcol);
wallscan_drawcol1(x, y1, y2, sampler, draw1column);
}
// The aligned columns
for (int x = aligned_x1; x < aligned_x2; x += 4)
{ {
for (z = 0; z < 4; ++z) // Find y1, y2, light and uv values for four columns:
int y1[4] = { uwal[x], uwal[x + 1], uwal[x + 2], uwal[x + 3] };
int y2[4] = { dwal[x], dwal[x + 1], dwal[x + 2], dwal[x + 3] };
float lights[4];
for (int i = 0; i < 4; i++)
{ {
lights[i] = light;
light += rw_lightstep; light += rw_lightstep;
palookupoffse[z] = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
} }
u4 = MAX(MAX(y1ve[0],y1ve[1]),MAX(y1ve[2],y1ve[3])); WallscanSampler sampler[4];
d4 = MIN(MIN(y2ve[0],y2ve[1]),MIN(y2ve[2],y2ve[3])); for (int i = 0; i < 4; i++)
sampler[i] = WallscanSampler(y1[i], swal[x + i], yrepeat, lwal[x + i] + xoffset, rw_pic, getcol);
if ((bad != 0) || (u4 >= d4)) // Figure out where we vertically can start and stop drawing 4 columns in one go
int middle_y1 = y1[0];
int middle_y2 = y2[0];
for (int i = 1; i < 4; i++)
{ {
for (z = 0; z < 4; ++z) middle_y1 = MAX(y1[i], middle_y1);
{ middle_y2 = MIN(y2[i], middle_y2);
if (!(bad & 1))
{
prevline1(vince[z],palookupoffse[z],y2ve[z]-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+x+z+dc_destorg);
} }
bad >>= 1;
// If we got an empty column in our set we cannot draw 4 columns in one go:
bool empty_column_in_set = false;
for (int i = 0; i < 4; i++)
{
if (y2[i] <= y1[i])
empty_column_in_set = true;
}
if (empty_column_in_set || middle_y2 <= middle_y1)
{
for (int i = 0; i < 4; i++)
{
if (y2[i] <= y1[i])
continue;
if (!fixed)
dc_colormap = basecolormap->Maps + (GETPALOOKUP(lights[i], wallshade) << COLORMAPSHIFT);
wallscan_drawcol1(x + i, y1[i], y2[i], sampler[i], draw1column);
} }
continue; continue;
} }
for (z = 0; z < 4; ++z) // Draw the first rows where not all 4 columns are active
for (int i = 0; i < 4; i++)
{ {
if (u4 > y1ve[z]) if (!fixed)
dc_colormap = basecolormap->Maps + (GETPALOOKUP(lights[i], wallshade) << COLORMAPSHIFT);
if (y1[i] < middle_y1)
wallscan_drawcol1(x + i, y1[i], middle_y1, sampler[i], draw1column);
}
// Draw the area where all 4 columns are active
if (!fixed)
{ {
vplce[z] = prevline1(vince[z],palookupoffse[z],u4-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+x+z+dc_destorg); for (int i = 0; i < 4; i++)
{
palookupoffse[i] = basecolormap->Maps + (GETPALOOKUP(lights[i], wallshade) << COLORMAPSHIFT);
}
}
wallscan_drawcol4(x, middle_y1, middle_y2, sampler, draw4columns);
// Draw the last rows where not all 4 columns are active
for (int i = 0; i < 4; i++)
{
if (!fixed)
dc_colormap = basecolormap->Maps + (GETPALOOKUP(lights[i], wallshade) << COLORMAPSHIFT);
if (middle_y2 < y2[i])
wallscan_drawcol1(x + i, middle_y2, y2[i], sampler[i], draw1column);
} }
} }
if (d4 > u4) // The last unaligned columns:
for (int x = aligned_x2; x < x2; x++, light += rw_lightstep)
{ {
dc_count = d4-u4; int y1 = uwal[x];
dc_dest = ylookup[u4]+x+dc_destorg; int y2 = dwal[x];
dovline4(); if (y2 <= y1)
} continue;
BYTE *i = x+ylookup[d4]+dc_destorg;
for (z = 0; z < 4; ++z)
{
if (y2ve[z] > d4)
{
prevline1(vince[z],palookupoffse[0],y2ve[z]-d4,vplce[z],bufplce[z],i+z);
}
}
}
for(;x<x2;x++)
{
light += rw_lightstep;
y1ve[0] = uwal[x];//max(uwal[x],umost[x]);
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]);
if (y2ve[0] <= y1ve[0]) continue;
assert (y1ve[0] < viewheight);
assert (y2ve[0] <= viewheight);
if (!fixed) if (!fixed)
{ // calculate lighting dc_colormap = basecolormap->Maps + (GETPALOOKUP(light, wallshade) << COLORMAPSHIFT);
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
WallscanSampler sampler(y1, swal[x], yrepeat, lwal[x] + xoffset, rw_pic, getcol);
wallscan_drawcol1(x, y1, y2, sampler, draw1column);
} }
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + x + dc_destorg;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
dovline1();
}
//unclock (WallScanCycles);
NetUpdate(); NetUpdate();
} }
void wallscan(int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x))
{
wallscan_any(x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol, [](int bits, Draw1ColumnFuncPtr &line1, Draw4ColumnsFuncPtr &line4)
{
setupvline(bits);
line1 = dovline1;
line4 = dovline4;
});
}
void maskwallscan(int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x))
{
if (!rw_pic->bMasked) // Textures that aren't masked can use the faster wallscan.
{
wallscan(x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol);
}
else
{
wallscan_any(x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol, [](int bits, Draw1ColumnFuncPtr &line1, Draw4ColumnsFuncPtr &line4)
{
setupmvline(bits);
line1 = domvline1;
line4 = domvline4;
});
}
}
void transmaskwallscan(int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x))
{
static fixed_t(*tmvline1)();
static void(*tmvline4)();
if (!R_GetTransMaskDrawers(&tmvline1, &tmvline4))
{
// The current translucency is unsupported, so draw with regular maskwallscan instead.
maskwallscan(x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol);
}
else
{
wallscan_any(x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol, [](int bits, Draw1ColumnFuncPtr &line1, Draw4ColumnsFuncPtr &line4)
{
setuptmvline(bits);
line1 = reinterpret_cast<DWORD(*)()>(tmvline1);
line4 = tmvline4;
});
}
}
void wallscan_striped (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat) void wallscan_striped (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat)
{ {
FDynamicColormap *startcolormap = basecolormap; FDynamicColormap *startcolormap = basecolormap;
@ -1423,370 +1602,6 @@ static void wallscan_np2_ds(drawseg_t *ds, int x1, int x2, short *uwal, short *d
} }
} }
inline fixed_t mvline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplce, const BYTE *bufplce, BYTE *dest)
{
dc_iscale = vince;
dc_colormap = colormap;
dc_count = count;
dc_texturefrac = vplce;
dc_source = bufplce;
dc_dest = dest;
return domvline1 ();
}
void maskwallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal,
double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x))
{
int x, fracbits;
BYTE *p;
int y1ve[4], y2ve[4], u4, d4, startx, dax, z;
char bad;
float light = rw_light - rw_lightstep;
SDWORD xoffset;
BYTE *basecolormapdata;
double iscale;
if (rw_pic->UseType == FTexture::TEX_Null)
{
return;
}
if (!rw_pic->bMasked)
{ // Textures that aren't masked can use the faster wallscan.
wallscan (x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol);
return;
}
//extern cycle_t WallScanCycles;
//clock (WallScanCycles);
rw_pic->GetHeight(); // Make sure texture size is loaded
fracbits = 32- rw_pic->HeightBits;
if (fracbits == 32)
{ // Hack for one pixel tall textures
fracbits = 0;
yrepeat = 0;
dc_texturemid = 0;
}
setupmvline(fracbits);
xoffset = rw_offset;
basecolormapdata = basecolormap->Maps;
x = startx = x1;
p = x + dc_destorg;
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
if (fixed)
{
palookupoffse[0] = dc_colormap;
palookupoffse[1] = dc_colormap;
palookupoffse[2] = dc_colormap;
palookupoffse[3] = dc_colormap;
}
for(; (x < x2) && ((size_t)p & 3); ++x, ++p)
{
light += rw_lightstep;
y1ve[0] = uwal[x];//max(uwal[x],umost[x]);
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]);
if (y2ve[0] <= y1ve[0]) continue;
if (!fixed)
{ // calculate lighting
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + p;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
domvline1();
}
for(; x < x2-3; x += 4, p+= 4)
{
bad = 0;
for (z = 3, dax = x+3; z >= 0; --z, --dax)
{
y1ve[z] = uwal[dax];
y2ve[z] = dwal[dax];
if (y2ve[z] <= y1ve[z]) { bad += 1<<z; continue; }
bufplce[z] = getcol (rw_pic, (lwal[dax] + xoffset) >> FRACBITS);
iscale = swal[dax] * yrepeat;
vince[z] = xs_ToFixed(fracbits, iscale);
vplce[z] = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[z] - CenterY + 0.5));
}
if (bad == 15)
{
light += rw_lightstep * 4;
continue;
}
if (!fixed)
{
for (z = 0; z < 4; ++z)
{
light += rw_lightstep;
palookupoffse[z] = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
}
u4 = MAX(MAX(y1ve[0],y1ve[1]),MAX(y1ve[2],y1ve[3]));
d4 = MIN(MIN(y2ve[0],y2ve[1]),MIN(y2ve[2],y2ve[3]));
if ((bad != 0) || (u4 >= d4))
{
for (z = 0; z < 4; ++z)
{
if (!(bad & 1))
{
mvline1(vince[z],palookupoffse[z],y2ve[z]-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+p+z);
}
bad >>= 1;
}
continue;
}
for (z = 0; z < 4; ++z)
{
if (u4 > y1ve[z])
{
vplce[z] = mvline1(vince[z],palookupoffse[z],u4-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+p+z);
}
}
if (d4 > u4)
{
dc_count = d4-u4;
dc_dest = ylookup[u4]+p;
domvline4();
}
BYTE *i = p+ylookup[d4];
for (z = 0; z < 4; ++z)
{
if (y2ve[z] > d4)
{
mvline1(vince[z],palookupoffse[0],y2ve[z]-d4,vplce[z],bufplce[z],i+z);
}
}
}
for(; x < x2; ++x, ++p)
{
light += rw_lightstep;
y1ve[0] = uwal[x];
y2ve[0] = dwal[x];
if (y2ve[0] <= y1ve[0]) continue;
if (!fixed)
{ // calculate lighting
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + p;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
domvline1();
}
//unclock(WallScanCycles);
NetUpdate ();
}
inline void preptmvline1 (fixed_t vince, BYTE *colormap, int count, fixed_t vplce, const BYTE *bufplce, BYTE *dest)
{
dc_iscale = vince;
dc_colormap = colormap;
dc_count = count;
dc_texturefrac = vplce;
dc_source = bufplce;
dc_dest = dest;
}
void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal,
double yrepeat, const BYTE *(*getcol)(FTexture *tex, int x))
{
fixed_t (*tmvline1)();
void (*tmvline4)();
int x, fracbits;
BYTE *p;
int y1ve[4], y2ve[4], u4, d4, startx, dax, z;
char bad;
float light = rw_light - rw_lightstep;
SDWORD xoffset;
BYTE *basecolormapdata;
double iscale;
if (rw_pic->UseType == FTexture::TEX_Null)
{
return;
}
if (!R_GetTransMaskDrawers (&tmvline1, &tmvline4))
{
// The current translucency is unsupported, so draw with regular maskwallscan instead.
maskwallscan (x1, x2, uwal, dwal, swal, lwal, yrepeat, getcol);
return;
}
//extern cycle_t WallScanCycles;
//clock (WallScanCycles);
rw_pic->GetHeight(); // Make sure texture size is loaded
fracbits = 32 - rw_pic->HeightBits;
if (fracbits == 32)
{ // Hack for one pixel tall textures
fracbits = 0;
yrepeat = 0;
dc_texturemid = 0;
}
setuptmvline(fracbits);
xoffset = rw_offset;
basecolormapdata = basecolormap->Maps;
fixed_t centeryfrac = FLOAT2FIXED(CenterY);
x = startx = x1;
p = x + dc_destorg;
bool fixed = (fixedcolormap != NULL || fixedlightlev >= 0);
if (fixed)
{
palookupoffse[0] = dc_colormap;
palookupoffse[1] = dc_colormap;
palookupoffse[2] = dc_colormap;
palookupoffse[3] = dc_colormap;
}
for(; (x < x2) && ((size_t)p & 3); ++x, ++p)
{
light += rw_lightstep;
y1ve[0] = uwal[x];//max(uwal[x],umost[x]);
y2ve[0] = dwal[x];//min(dwal[x],dmost[x]);
if (y2ve[0] <= y1ve[0]) continue;
if (!fixed)
{ // calculate lighting
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + p;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
tmvline1();
}
for(; x < x2-3; x += 4, p+= 4)
{
bad = 0;
for (z = 3, dax = x+3; z >= 0; --z, --dax)
{
y1ve[z] = uwal[dax];
y2ve[z] = dwal[dax];
if (y2ve[z] <= y1ve[z]) { bad += 1<<z; continue; }
bufplce[z] = getcol (rw_pic, (lwal[dax] + xoffset) >> FRACBITS);
iscale = swal[dax] * yrepeat;
vince[z] = xs_ToFixed(fracbits, iscale);
vplce[z] = xs_ToFixed(fracbits, dc_texturemid + vince[z] * (y1ve[z] - CenterY + 0.5));
}
if (bad == 15)
{
light += rw_lightstep * 4;
continue;
}
if (!fixed)
{
for (z = 0; z < 4; ++z)
{
light += rw_lightstep;
palookupoffse[z] = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
}
u4 = MAX(MAX(y1ve[0],y1ve[1]),MAX(y1ve[2],y1ve[3]));
d4 = MIN(MIN(y2ve[0],y2ve[1]),MIN(y2ve[2],y2ve[3]));
if ((bad != 0) || (u4 >= d4))
{
for (z = 0; z < 4; ++z)
{
if (!(bad & 1))
{
preptmvline1(vince[z],palookupoffse[z],y2ve[z]-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+p+z);
tmvline1();
}
bad >>= 1;
}
continue;
}
for (z = 0; z < 4; ++z)
{
if (u4 > y1ve[z])
{
preptmvline1(vince[z],palookupoffse[z],u4-y1ve[z],vplce[z],bufplce[z],ylookup[y1ve[z]]+p+z);
vplce[z] = tmvline1();
}
}
if (d4 > u4)
{
dc_count = d4-u4;
dc_dest = ylookup[u4]+p;
tmvline4();
}
BYTE *i = p+ylookup[d4];
for (z = 0; z < 4; ++z)
{
if (y2ve[z] > d4)
{
preptmvline1(vince[z],palookupoffse[0],y2ve[z]-d4,vplce[z],bufplce[z],i+z);
tmvline1();
}
}
}
for(; x < x2; ++x, ++p)
{
light += rw_lightstep;
y1ve[0] = uwal[x];
y2ve[0] = dwal[x];
if (y2ve[0] <= y1ve[0]) continue;
if (!fixed)
{ // calculate lighting
dc_colormap = basecolormapdata + (GETPALOOKUP (light, wallshade) << COLORMAPSHIFT);
}
dc_source = getcol (rw_pic, (lwal[x] + xoffset) >> FRACBITS);
dc_dest = ylookup[y1ve[0]] + p;
dc_count = y2ve[0] - y1ve[0];
iscale = swal[x] * yrepeat;
dc_iscale = xs_ToFixed(fracbits, iscale);
dc_texturefrac = xs_ToFixed(fracbits, dc_texturemid + iscale * (y1ve[0] - CenterY + 0.5));
tmvline1();
}
//unclock(WallScanCycles);
NetUpdate ();
}
// //
// R_RenderSegLoop // R_RenderSegLoop
// Draws zero, one, or two textures for walls. // Draws zero, one, or two textures for walls.

View file

@ -281,6 +281,15 @@ void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *span, bool us
dc_source = column; dc_source = column;
dc_dest = (ylookup[dc_yl] + dc_x) + dc_destorg; dc_dest = (ylookup[dc_yl] + dc_x) + dc_destorg;
dc_count = dc_yh - dc_yl + 1; dc_count = dc_yh - dc_yl + 1;
fixed_t maxfrac = ((top + length) << FRACBITS) - 1;
dc_texturefrac = MAX(dc_texturefrac, 0);
dc_texturefrac = MIN(dc_texturefrac, maxfrac);
if (dc_iscale > 0)
dc_count = MIN(dc_count, (maxfrac - dc_texturefrac + dc_iscale - 1) / dc_iscale);
else if (dc_iscale < 0)
dc_count = MIN(dc_count, (dc_texturefrac - dc_iscale) / (-dc_iscale));
if (useRt) if (useRt)
hcolfunc_pre(); hcolfunc_pre();
else else
@ -954,15 +963,14 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
return; return;
tx += tex->GetWidth() * thingxscalemul; tx += tex->GetWidth() * thingxscalemul;
double dtx2 = tx * xscale; x2 = centerx + xs_RoundToInt(tx * xscale);
x2 = centerx + xs_RoundToInt(dtx2);
// off the left side or too small? // off the left side or too small?
if ((x2 < WindowLeft || x2 <= x1)) if ((x2 < WindowLeft || x2 <= x1))
return; return;
xscale = spriteScale.X * xscale / tex->Scale.X; xscale = spriteScale.X * xscale / tex->Scale.X;
iscale = (fixed_t)(tex->GetWidth() / (dtx2 - dtx1) * FRACUNIT); iscale = (fixed_t)(FRACUNIT / xscale); // Round towards zero to avoid wrapping in edge cases
double yscale = spriteScale.Y / tex->Scale.Y; double yscale = spriteScale.Y / tex->Scale.Y;
@ -990,7 +998,7 @@ void R_ProjectSprite (AActor *thing, int fakeside, F3DFloor *fakefloor, F3DFloor
vis->xiscale = iscale; vis->xiscale = iscale;
} }
vis->startfrac += (fixed_t)(vis->xiscale * (vis->x1 - centerx - dtx1 + 0.5 * thingxscalemul)); vis->startfrac += (fixed_t)(vis->xiscale * (vis->x1 - centerx + 0.5 - dtx1));
} }
else else
{ {

View file

@ -1282,7 +1282,7 @@ void DCanvas::FinishSimplePolys()
void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley, DAngle rotation, double originx, double originy, double scalex, double scaley, DAngle rotation,
FDynamicColormap *colormap, int lightlevel) FDynamicColormap *colormap, int lightlevel, int bottomclip)
{ {
#ifndef NO_SWRENDER #ifndef NO_SWRENDER
// Use an equation similar to player sprites to determine shade // Use an equation similar to player sprites to determine shade
@ -1300,6 +1300,11 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
return; return;
} }
if (bottomclip <= 0)
{
bottomclip = Height;
}
// Find the extents of the polygon, in particular the highest and lowest points. // Find the extents of the polygon, in particular the highest and lowest points.
for (botpt = toppt = 0, boty = topy = points[0].Y, leftx = rightx = points[0].X, i = 1; i <= npoints; ++i) for (botpt = toppt = 0, boty = topy = points[0].Y, leftx = rightx = points[0].X, i = 1; i <= npoints; ++i)
{ {
@ -1322,7 +1327,7 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
rightx = points[i].X; rightx = points[i].X;
} }
} }
if (topy >= Height || // off the bottom of the screen if (topy >= bottomclip || // off the bottom of the screen
boty <= 0 || // off the top of the screen boty <= 0 || // off the top of the screen
leftx >= Width || // off the right of the screen leftx >= Width || // off the right of the screen
rightx <= 0) // off the left of the screen rightx <= 0) // off the left of the screen
@ -1348,10 +1353,26 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
R_SetupSpanBits(tex); R_SetupSpanBits(tex);
R_SetSpanColormap(colormap != NULL ? &colormap->Maps[clamp(shade >> FRACBITS, 0, NUMCOLORMAPS-1) * 256] : identitymap); R_SetSpanColormap(colormap != NULL ? &colormap->Maps[clamp(shade >> FRACBITS, 0, NUMCOLORMAPS-1) * 256] : identitymap);
R_SetSpanSource(tex->GetPixels()); R_SetSpanSource(tex->GetPixels());
if (ds_xbits != 0)
{
scalex = double(1u << (32 - ds_xbits)) / scalex; scalex = double(1u << (32 - ds_xbits)) / scalex;
scaley = double(1u << (32 - ds_ybits)) / scaley;
ds_xstep = xs_RoundToInt(cosrot * scalex); ds_xstep = xs_RoundToInt(cosrot * scalex);
}
else
{ // Texture is one pixel wide.
scalex = 0;
ds_xstep = 0;
}
if (ds_ybits != 0)
{
scaley = double(1u << (32 - ds_ybits)) / scaley;
ds_ystep = xs_RoundToInt(sinrot * scaley); ds_ystep = xs_RoundToInt(sinrot * scaley);
}
else
{ // Texture is one pixel tall.
scaley = 0;
ds_ystep = 0;
}
// Travel down the right edge and create an outline of that edge. // Travel down the right edge and create an outline of that edge.
pt1 = toppt; pt1 = toppt;
@ -1361,13 +1382,13 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
{ {
x = FLOAT2FIXED(points[pt1].X + 0.5f); x = FLOAT2FIXED(points[pt1].X + 0.5f);
y2 = xs_RoundToInt(points[pt2].Y + 0.5f); y2 = xs_RoundToInt(points[pt2].Y + 0.5f);
if (y1 >= y2 || (y1 < 0 && y2 < 0) || (y1 >= Height && y2 >= Height)) if (y1 >= y2 || (y1 < 0 && y2 < 0) || (y1 >= bottomclip && y2 >= bottomclip))
{ {
} }
else else
{ {
fixed_t xinc = FLOAT2FIXED((points[pt2].X - points[pt1].X) / (points[pt2].Y - points[pt1].Y)); fixed_t xinc = FLOAT2FIXED((points[pt2].X - points[pt1].X) / (points[pt2].Y - points[pt1].Y));
int y3 = MIN(y2, Height); int y3 = MIN(y2, bottomclip);
if (y1 < 0) if (y1 < 0)
{ {
x += xinc * -y1; x += xinc * -y1;
@ -1392,13 +1413,13 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
{ {
x = FLOAT2FIXED(points[pt1].X + 0.5f); x = FLOAT2FIXED(points[pt1].X + 0.5f);
y2 = xs_RoundToInt(points[pt2].Y + 0.5f); y2 = xs_RoundToInt(points[pt2].Y + 0.5f);
if (y1 >= y2 || (y1 < 0 && y2 < 0) || (y1 >= Height && y2 >= Height)) if (y1 >= y2 || (y1 < 0 && y2 < 0) || (y1 >= bottomclip && y2 >= bottomclip))
{ {
} }
else else
{ {
fixed_t xinc = FLOAT2FIXED((points[pt2].X - points[pt1].X) / (points[pt2].Y - points[pt1].Y)); fixed_t xinc = FLOAT2FIXED((points[pt2].X - points[pt1].X) / (points[pt2].Y - points[pt1].Y));
int y3 = MIN(y2, Height); int y3 = MIN(y2, bottomclip);
if (y1 < 0) if (y1 < 0)
{ {
x += xinc * -y1; x += xinc * -y1;

View file

@ -224,7 +224,7 @@ public:
// Fill a simple polygon with a texture // Fill a simple polygon with a texture
virtual void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, virtual void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley, DAngle rotation, double originx, double originy, double scalex, double scaley, DAngle rotation,
struct FDynamicColormap *colormap, int lightlevel); struct FDynamicColormap *colormap, int lightlevel, int bottomclip);
// Set an area to a specified color // Set an area to a specified color
virtual void Clear (int left, int top, int right, int bottom, int palcolor, uint32 color); virtual void Clear (int left, int top, int right, int bottom, int palcolor, uint32 color);

View file

@ -3084,11 +3084,16 @@ void D3DFB::FlatFill(int left, int top, int right, int bottom, FTexture *src, bo
// //
// Here, "simple" means that a simple triangle fan can draw it. // Here, "simple" means that a simple triangle fan can draw it.
// //
// Bottomclip is ignored by this implementation, since the hardware renderer
// will unconditionally draw the status bar border every frame on top of the
// polygons, so there's no need to waste time setting up a special scissor
// rectangle here and needlessly forcing separate batches.
//
//========================================================================== //==========================================================================
void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints, void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley, double originx, double originy, double scalex, double scaley,
DAngle rotation, FDynamicColormap *colormap, int lightlevel) DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip)
{ {
// Use an equation similar to player sprites to determine shade // Use an equation similar to player sprites to determine shade
double fadelevel = clamp((LIGHT2SHADE(lightlevel)/65536. - 12) / NUMCOLORMAPS, 0.0, 1.0); double fadelevel = clamp((LIGHT2SHADE(lightlevel)/65536. - 12) / NUMCOLORMAPS, 0.0, 1.0);
@ -3109,7 +3114,7 @@ void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
} }
if (In2D < 2) if (In2D < 2)
{ {
Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, lightlevel); Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, lightlevel, bottomclip);
return; return;
} }
if (!InScene) if (!InScene)

View file

@ -265,7 +265,7 @@ public:
void DrawPixel(int x, int y, int palcolor, uint32 rgbcolor); void DrawPixel(int x, int y, int palcolor, uint32 rgbcolor);
void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley, double originx, double originy, double scalex, double scaley,
DAngle rotation, FDynamicColormap *colormap, int lightlevel); DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip) override;
bool WipeStartScreen(int type); bool WipeStartScreen(int type);
void WipeEndScreen(); void WipeEndScreen();
bool WipeDo(int ticks); bool WipeDo(int ticks);