mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
Merge commit '9caf5c641b374848c065059b5152339806fa7734'
This commit is contained in:
commit
959ac8c65b
6 changed files with 51 additions and 19 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue