Merge commit '9caf5c641b374848c065059b5152339806fa7734'

This commit is contained in:
Rachael Alexanderson 2017-02-15 05:28:38 -05:00
commit 959ac8c65b
6 changed files with 51 additions and 19 deletions

View File

@ -192,7 +192,7 @@ private:
bool PutWallCompat(int passflag);
void PutWall(bool translucent);
void PutPortal(int ptype);
void CheckTexturePosition();
void CheckTexturePosition(FTexCoordInfo *tci);
void RenderFogBoundaryCompat();
void RenderLightsCompat(int pass);

View File

@ -626,7 +626,7 @@ bool GLWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float textureto
//
//==========================================================================
void GLWall::CheckTexturePosition()
void GLWall::CheckTexturePosition(FTexCoordInfo *tci)
{
float sub;
@ -634,23 +634,47 @@ void GLWall::CheckTexturePosition()
// clamp texture coordinates to a reasonable range.
// Extremely large values can cause visual problems
if (tcs[UPLFT].v < tcs[UPRGT].v)
if (tci->mScale.Y > 0)
{
sub = float(xs_FloorToInt(tcs[UPLFT].v));
if (tcs[UPLFT].v < tcs[UPRGT].v)
{
sub = float(xs_FloorToInt(tcs[UPLFT].v));
}
else
{
sub = float(xs_FloorToInt(tcs[UPRGT].v));
}
tcs[UPLFT].v -= sub;
tcs[UPRGT].v -= sub;
tcs[LOLFT].v -= sub;
tcs[LORGT].v -= sub;
if ((tcs[UPLFT].v == 0.f && tcs[UPRGT].v == 0.f && tcs[LOLFT].v <= 1.f && tcs[LORGT].v <= 1.f) ||
(tcs[UPLFT].v >= 0.f && tcs[UPRGT].v >= 0.f && tcs[LOLFT].v == 1.f && tcs[LORGT].v == 1.f))
{
flags |= GLT_CLAMPY;
}
}
else
{
sub = float(xs_FloorToInt(tcs[UPRGT].v));
}
tcs[UPLFT].v -= sub;
tcs[UPRGT].v -= sub;
tcs[LOLFT].v -= sub;
tcs[LORGT].v -= sub;
if (tcs[LOLFT].v < tcs[LORGT].v)
{
sub = float(xs_FloorToInt(tcs[LOLFT].v));
}
else
{
sub = float(xs_FloorToInt(tcs[LORGT].v));
}
tcs[UPLFT].v -= sub;
tcs[UPRGT].v -= sub;
tcs[LOLFT].v -= sub;
tcs[LORGT].v -= sub;
if ((tcs[UPLFT].v == 0.f && tcs[UPRGT].v == 0.f && tcs[LOLFT].v <= 1.f && tcs[LORGT].v <= 1.f) ||
(tcs[UPLFT].v >= 0.f && tcs[UPRGT].v >= 0.f && tcs[LOLFT].v == 1.f && tcs[LORGT].v == 1.f))
{
flags |= GLT_CLAMPY;
if ((tcs[LOLFT].v == 0.f && tcs[LORGT].v == 0.f && tcs[UPLFT].v <= 1.f && tcs[UPRGT].v <= 1.f) ||
(tcs[LOLFT].v >= 0.f && tcs[LORGT].v >= 0.f && tcs[UPLFT].v == 1.f && tcs[UPRGT].v == 1.f))
{
flags |= GLT_CLAMPY;
}
}
// Check if this is marked as a skybox and if so, do the same for x.
@ -721,7 +745,7 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg,
else
{
CheckTexturePosition();
CheckTexturePosition(&tci);
// Add this wall to the render list
sector_t * sec = sub ? sub->sector : seg->frontsector;
@ -1139,7 +1163,7 @@ void GLWall::BuildFFBlock(seg_t * seg, F3DFloor * rover,
tcs[LOLFT].v = tci.FloatToTexV(to - ff_bottomleft);
tcs[LORGT].v = tci.FloatToTexV(to - ff_bottomright);
type = RENDERWALL_FFBLOCK;
CheckTexturePosition();
CheckTexturePosition(&tci);
}
ztop[0] = ff_topleft;

View File

@ -448,6 +448,12 @@ DEFINE_ACTION_FUNCTION(DMenu, GetItem)
ACTION_RETURN_OBJECT(self->GetItem(name));
}
DEFINE_ACTION_FUNCTION(DOptionMenuDescriptor, GetItem)
{
PARAM_SELF_PROLOGUE(DOptionMenuDescriptor);
PARAM_NAME(name);
ACTION_RETURN_OBJECT(self->GetItem(name));
}
bool DMenu::DimAllowed()

View File

@ -1256,6 +1256,7 @@ DEFINE_ACTION_FUNCTION(DObject, S_Sound)
PARAM_INT(channel);
PARAM_FLOAT_DEF(volume);
PARAM_FLOAT_DEF(attn);
S_Sound(channel, id, volume, attn);
return 0;
}

View File

@ -57,7 +57,7 @@ class OptionMenuDescriptor : MenuDescriptor native
native bool mDontDim;
native void CalcIndent();
//native OptionMenuItem GetItem(Name iname);
native OptionMenuItem GetItem(Name iname);
void Reset()
{
// Reset the default settings (ignore all other values in the struct)

View File

@ -132,11 +132,11 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
override bool Activate()
{
// This needs to perform a few checks to prevent abuse by malicious modders.
let m = Menu.GetCurrentMenu();
let m = OptionMenu(Menu.GetCurrentMenu());
// don't execute if no menu is active
if (m == null) return false;
// don't execute if this item cannot be found in the current menu.
if (m.GetItem(mAction) != self) return false;
if (m.mDesc.GetItem(mAction) != self) return false;
Menu.MenuSound("menu/choose");
DoCommand(mAction);
return true;
@ -1197,6 +1197,7 @@ class OptionMenuItemNumberField : OptionMenuFieldBase
mCVar.SetFloat(value);
Menu.MenuSound("menu/change");
}
else return Super.MenuEvent(mkey, fromcontroller);
return true;
}