This commit is contained in:
Rachael Alexanderson 2017-03-25 00:18:55 -04:00
commit 2494f1e49d
13 changed files with 63 additions and 25 deletions

View file

@ -1035,7 +1035,6 @@ public:
{ // Calculate cleanX and cleanY
wrapper->ScreenSizeChanged();
}
wrapper->GetCoords(ST_X, ST_Y);
int hud = STBAR_NORMAL;
if(state == HUD_StatusBar)
{
@ -1225,8 +1224,10 @@ public:
if(!fullScreenOffsets)
{
double tmp = 0;
dx += ST_X;
dy += ST_Y - (Scaled ? script->resH : 200) + script->height;
int stX, stY;
wrapper->GetCoords(stX, stY);
dx += stX;
dy += stY - (Scaled ? script->resH : 200) + script->height;
w = forceWidth < 0 ? texture->GetScaledWidthDouble() : forceWidth;
h = forceHeight < 0 ? texture->GetScaledHeightDouble() : forceHeight;
double dcx = clip[0] == 0 ? 0 : dx + clip[0] - texture->GetScaledLeftOffsetDouble();
@ -1451,8 +1452,10 @@ public:
if(!fullScreenOffsets)
{
rx += ST_X;
ry += ST_Y - (Scaled ? script->resH : 200) + script->height;
int stX, stY;
wrapper->GetCoords(stX, stY);
rx += stX;
ry += stY - (Scaled ? script->resH : 200) + script->height;
if(Scaled)
screen->VirtualToRealCoords(rx, ry, rw, rh, script->resW, script->resH, true);
else
@ -1520,7 +1523,6 @@ public:
player_t *CPlayer = nullptr;
DBaseStatusBar *wrapper;
bool Scaled;
int ST_X, ST_Y;
private:
SBarInfo *script;

View file

@ -1898,7 +1898,7 @@ DEFINE_ACTION_FUNCTION(AStateProvider, A_FireProjectile)
// Temporarily adjusts the pitch
DAngle saved_player_pitch = self->Angles.Pitch;
self->Angles.Pitch -= pitch;
self->Angles.Pitch += pitch;
AActor * misl=P_SpawnPlayerMissile (self, ofs.X, ofs.Y, spawnheight, ti, shootangle, &t, NULL, false, (flags & FPF_NOAUTOAIM) != 0);
self->Angles.Pitch = saved_player_pitch;
@ -6852,3 +6852,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetMugshotState)
StatusBar->SetMugShotState(name);
return 0;
}
// This needs to account for the fact that internally renderstyles are stored as a series of operations,
// but the script side only cares about symbolic constants.
DEFINE_ACTION_FUNCTION(AActor, GetRenderStyle)
{
PARAM_SELF_PROLOGUE(AActor);
for(unsigned i=0;i<STYLE_Count;i++)
{
if (self->RenderStyle == LegacyRenderStyles[i]) ACTION_RETURN_INT(i);
}
ACTION_RETURN_INT(-1); // no symbolic constant exists to handle this style.
}

View file

@ -616,6 +616,7 @@ void DAnimatedDoor::Tick ()
}
m_Timer = m_Delay;
m_Status = Waiting;
}
else
{

View file

@ -5136,7 +5136,8 @@ void P_RailAttack(FRailParams *p)
if (puffDefaults->flags3 & MF3_FOILINVUL) dmgFlagPass |= DMG_FOILINVUL;
if (puffDefaults->flags7 & MF7_FOILBUDDHA) dmgFlagPass |= DMG_FOILBUDDHA;
}
int newdam = P_DamageMobj(hitactor, thepuff ? thepuff : source, source, p->damage, damagetype, dmgFlagPass|DMG_USEANGLE, hitangle);
// [RK] If the attack source is a player, send the DMG_PLAYERATTACK flag.
int newdam = P_DamageMobj(hitactor, thepuff ? thepuff : source, source, p->damage, damagetype, dmgFlagPass | DMG_USEANGLE | (source->player ? DMG_PLAYERATTACK : 0), hitangle);
if (bleed)
{

View file

@ -492,18 +492,18 @@ void S_PrecacheLevel ()
actor->MarkPrecacheSounds();
}
}
for (auto i : gameinfo.PrecachedSounds)
for (auto snd : gameinfo.PrecachedSounds)
{
level.info->PrecacheSounds[i].MarkUsed();
FSoundID(snd).MarkUsed();
}
for (auto i : gameinfo.PrecachedSounds)
{
level.info->PrecacheSounds[i].MarkUsed();
}
// Precache all extra sounds requested by this map.
for (i = 0; i < level.info->PrecacheSounds.Size(); ++i)
for (auto snd : level.info->PrecacheSounds)
{
level.info->PrecacheSounds[i].MarkUsed();
FSoundID(snd).MarkUsed();
}
// Don't unload sounds that are playing right now.
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)

View file

@ -2514,7 +2514,7 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build)
if (IsBitWrite == -1)
{
build->Emit(ValueType->GetStoreOp(), pointer.RegNum, result.RegNum, build->GetConstantInt(0));
build->Emit(Base->ValueType->GetStoreOp(), pointer.RegNum, result.RegNum, build->GetConstantInt(0));
}
else
{

View file

@ -570,7 +570,6 @@ size_t VMFunctionBuilder::Emit(int opcode, int opa, int opb, int opc)
assert(opb >= 0);
assert(opc >= 0);
// The following were just asserts, meaning this would silently create broken code if there was an overflow
// if this happened in a release build. Not good.
// These are critical errors that need to be reported to the user.

View file

@ -1783,14 +1783,23 @@ void ZCCCompiler::DispatchScriptProperty(PProperty *prop, ZCC_PropertyStmt *prop
ZCC_ExprConstant one;
unsigned parmcount = 1;
ZCC_TreeNode *x = property->Values;
while (x->SiblingNext != property->Values)
if (x == nullptr)
{
x = x->SiblingNext;
parmcount++;
parmcount = 0;
}
else
{
while (x->SiblingNext != property->Values)
{
x = x->SiblingNext;
parmcount++;
}
}
if (parmcount == 0 && prop->Variables.Size() == 1 && prop->Variables[0]->Type == TypeBool)
{
// allow boolean properties to have the parameter omitted
memset(&one, 0, sizeof(one));
one.SourceName = property->SourceName; // This may not be null!
one.Operation = PEX_ConstValue;
one.NodeType = AST_ExprConstant;
one.Type = TypeBool;
@ -1799,7 +1808,7 @@ void ZCCCompiler::DispatchScriptProperty(PProperty *prop, ZCC_PropertyStmt *prop
}
else if (parmcount != prop->Variables.Size())
{
Error(x, "Argument count mismatch: Got %u, expected %u", parmcount, prop->Variables.Size());
Error(x == nullptr? property : x, "Argument count mismatch: Got %u, expected %u", parmcount, prop->Variables.Size());
return;
}

View file

@ -1399,6 +1399,12 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
int cheight;
int cx1, cy1, cx2, cy2;
// For larger screems always use at least a 16:9 ratio for clean factor calculation, even if the actual ratio is narrower.
if (realwidth > 1280 && (double)realwidth / realheight < 16./9)
{
realheight = realwidth * 9 / 16;
}
ratio = ActiveRatio(realwidth, realheight);
if (AspectTallerThanWide(ratio))
{
@ -1416,7 +1422,7 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
cy1 = MAX(cheight / designheight, 1);
cx2 = MAX(realwidth / designwidth, 1);
cy2 = MAX(realheight / designheight, 1);
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || cx1 >= 4)
if (abs(cx1 - cy1) <= abs(cx2 - cy2) || MAX(cx1, cx2) >= 4)
{ // e.g. 640x360 looks better with this.
*cleanx = cx1;
*cleany = cy1;

View file

@ -46,12 +46,12 @@ const char *GetVersionString();
#ifdef GIT_DESCRIPTION
#define VERSIONSTR GIT_DESCRIPTION
#else
#define VERSIONSTR "2.3pre"
#define VERSIONSTR "2.4.0"
#endif
// The version as seen in the Windows resource
#define RC_FILEVERSION 2,3,9999,0
#define RC_PRODUCTVERSION 2,3,9999,0
#define RC_FILEVERSION 2,4,0,0
#define RC_PRODUCTVERSION 2,4,0,0
#define RC_PRODUCTVERSION2 VERSIONSTR
// These are for content versioning. The current state is '2.4'.
#define VER_MAJOR 2

View file

@ -718,6 +718,7 @@ bool Win32GLVideo::SetupPixelFormat(int multisample)
if (myWglChoosePixelFormatARB)
{
again:
attributes[0] = WGL_RED_BITS_ARB; //bits
attributes[1] = 8;
attributes[2] = WGL_GREEN_BITS_ARB; //bits
@ -773,6 +774,12 @@ bool Win32GLVideo::SetupPixelFormat(int multisample)
if (numFormats == 0)
{
if (vr_enable_quadbuffered)
{
Printf("R_OPENGL: No valid pixel formats found for VR quadbuffering. Retrying without this feature\n");
vr_enable_quadbuffered = false;
goto again;
}
Printf("R_OPENGL: No valid pixel formats found. Retrying in compatibility mode\n");
goto oldmethod;
}

View file

@ -449,6 +449,7 @@ class Actor : Thinker native
native void ChangeTid(int newtid);
native static int FindUniqueTid(int start = 0, int limit = 0);
native void SetShade(color col);
native clearscope int GetRenderStyle() const;
native clearscope string GetTag(string defstr = "") const;
native void SetTag(string defstr = "");

View file

@ -119,7 +119,7 @@ class ListMenuItemStaticText : ListMenuItem
int mColor;
bool mCentered;
void Init(ListMenuDescriptor desc, double x, double y, String text, int color = Font.CR_UNTRANSLATED)
void Init(ListMenuDescriptor desc, double x, double y, String text, int color = -1)
{
Super.Init(x, y);
mText = text;
@ -267,7 +267,7 @@ class ListMenuItemTextItem : ListMenuItemSelectable
override int GetWidth()
{
return min(1, mFont.StringWidth(StringTable.Localize(mText)));
return max(1, mFont.StringWidth(StringTable.Localize(mText)));
}
}