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

View file

@ -1898,7 +1898,7 @@ DEFINE_ACTION_FUNCTION(AStateProvider, A_FireProjectile)
// Temporarily adjusts the pitch // Temporarily adjusts the pitch
DAngle saved_player_pitch = self->Angles.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); 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; self->Angles.Pitch = saved_player_pitch;
@ -6852,3 +6852,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetMugshotState)
StatusBar->SetMugShotState(name); StatusBar->SetMugShotState(name);
return 0; 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_Timer = m_Delay;
m_Status = Waiting;
} }
else else
{ {

View file

@ -5136,7 +5136,8 @@ void P_RailAttack(FRailParams *p)
if (puffDefaults->flags3 & MF3_FOILINVUL) dmgFlagPass |= DMG_FOILINVUL; if (puffDefaults->flags3 & MF3_FOILINVUL) dmgFlagPass |= DMG_FOILINVUL;
if (puffDefaults->flags7 & MF7_FOILBUDDHA) dmgFlagPass |= DMG_FOILBUDDHA; 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) if (bleed)
{ {

View file

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

View file

@ -2514,7 +2514,7 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build)
if (IsBitWrite == -1) 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 else
{ {

View file

@ -570,7 +570,6 @@ size_t VMFunctionBuilder::Emit(int opcode, int opa, int opb, int opc)
assert(opb >= 0); assert(opb >= 0);
assert(opc >= 0); assert(opc >= 0);
// The following were just asserts, meaning this would silently create broken code if there was an overflow // 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. // if this happened in a release build. Not good.
// These are critical errors that need to be reported to the user. // 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; ZCC_ExprConstant one;
unsigned parmcount = 1; unsigned parmcount = 1;
ZCC_TreeNode *x = property->Values; ZCC_TreeNode *x = property->Values;
if (x == nullptr)
{
parmcount = 0;
}
else
{
while (x->SiblingNext != property->Values) while (x->SiblingNext != property->Values)
{ {
x = x->SiblingNext; x = x->SiblingNext;
parmcount++; parmcount++;
} }
}
if (parmcount == 0 && prop->Variables.Size() == 1 && prop->Variables[0]->Type == TypeBool) if (parmcount == 0 && prop->Variables.Size() == 1 && prop->Variables[0]->Type == TypeBool)
{ {
// allow boolean properties to have the parameter omitted // 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.Operation = PEX_ConstValue;
one.NodeType = AST_ExprConstant; one.NodeType = AST_ExprConstant;
one.Type = TypeBool; one.Type = TypeBool;
@ -1799,7 +1808,7 @@ void ZCCCompiler::DispatchScriptProperty(PProperty *prop, ZCC_PropertyStmt *prop
} }
else if (parmcount != prop->Variables.Size()) 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; return;
} }

View file

@ -1399,6 +1399,12 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
int cheight; int cheight;
int cx1, cy1, cx2, cy2; 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); ratio = ActiveRatio(realwidth, realheight);
if (AspectTallerThanWide(ratio)) if (AspectTallerThanWide(ratio))
{ {
@ -1416,7 +1422,7 @@ void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int real
cy1 = MAX(cheight / designheight, 1); cy1 = MAX(cheight / designheight, 1);
cx2 = MAX(realwidth / designwidth, 1); cx2 = MAX(realwidth / designwidth, 1);
cy2 = MAX(realheight / designheight, 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. { // e.g. 640x360 looks better with this.
*cleanx = cx1; *cleanx = cx1;
*cleany = cy1; *cleany = cy1;

View file

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

View file

@ -718,6 +718,7 @@ bool Win32GLVideo::SetupPixelFormat(int multisample)
if (myWglChoosePixelFormatARB) if (myWglChoosePixelFormatARB)
{ {
again:
attributes[0] = WGL_RED_BITS_ARB; //bits attributes[0] = WGL_RED_BITS_ARB; //bits
attributes[1] = 8; attributes[1] = 8;
attributes[2] = WGL_GREEN_BITS_ARB; //bits attributes[2] = WGL_GREEN_BITS_ARB; //bits
@ -773,6 +774,12 @@ bool Win32GLVideo::SetupPixelFormat(int multisample)
if (numFormats == 0) 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"); Printf("R_OPENGL: No valid pixel formats found. Retrying in compatibility mode\n");
goto oldmethod; goto oldmethod;
} }

View file

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

View file

@ -119,7 +119,7 @@ class ListMenuItemStaticText : ListMenuItem
int mColor; int mColor;
bool mCentered; 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); Super.Init(x, y);
mText = text; mText = text;
@ -267,7 +267,7 @@ class ListMenuItemTextItem : ListMenuItemSelectable
override int GetWidth() override int GetWidth()
{ {
return min(1, mFont.StringWidth(StringTable.Localize(mText))); return max(1, mFont.StringWidth(StringTable.Localize(mText)));
} }
} }