Merge branch 'master' of https://github.com/coelckers/gzdoom into vulkan2

# Conflicts:
#	src/posix/sdl/gl_sysfb.h
This commit is contained in:
Rachael Alexanderson 2019-03-31 03:49:08 -04:00
commit ead3695844
24 changed files with 52 additions and 79 deletions

View file

@ -137,14 +137,13 @@ FString D_UnescapeUserInfo (const char *str, size_t len)
int D_GenderToInt (const char *gender) int D_GenderToInt (const char *gender)
{ {
if (gender[0] == 'f') if (!stricmp(gender, "female")) return GENDER_FEMALE;
return GENDER_FEMALE; if (!stricmp(gender, "neutral")) return GENDER_NEUTER;
else if (gender[0] == 'n') if (!stricmp(gender, "neuter")) return GENDER_NEUTER;
return GENDER_NEUTER; if (!stricmp(gender, "other")) return GENDER_OBJECT;
else if (gender[0] == 'o') if (!stricmp(gender, "object")) return GENDER_OBJECT;
return GENDER_OBJECT; if (!stricmp(gender, "cyborg")) return GENDER_OBJECT;
else return GENDER_MALE;
return GENDER_MALE;
} }
int D_PlayerClassToInt (const char *classname) int D_PlayerClassToInt (const char *classname)

View file

@ -1461,7 +1461,7 @@ class CommandDrawNumber : public CommandDrawString
if(statusBar->CPlayer->mo->waterlevel < 3) if(statusBar->CPlayer->mo->waterlevel < 3)
num = primaryLevel->airsupply/TICRATE; num = primaryLevel->airsupply/TICRATE;
else else
num = clamp<int>((statusBar->CPlayer->air_finished - primaryLevel->time + (TICRATE-1))/TICRATE, 0, INT_MAX); num = clamp<int>((statusBar->CPlayer->air_finished - primaryLevel->maptime + (TICRATE-1))/TICRATE, 0, INT_MAX);
break; break;
} }
case SELECTEDINVENTORY: case SELECTEDINVENTORY:
@ -2751,7 +2751,7 @@ class CommandDrawBar : public SBarInfoCommand
break; break;
} }
case AIRTIME: case AIRTIME:
value = clamp<int>(statusBar->CPlayer->air_finished - primaryLevel->time, 0, INT_MAX); value = clamp<int>(statusBar->CPlayer->air_finished - primaryLevel->maptime, 0, INT_MAX);
max = primaryLevel->airsupply; max = primaryLevel->airsupply;
break; break;
case POWERUPTIME: case POWERUPTIME:

View file

@ -487,6 +487,17 @@ void FGameConfigFile::DoGlobalSetup ()
} }
} }
} }
if (last < 217)
{
auto var = FindCVar("vid_scalemode", NULL);
UCVarValue newvalue;
newvalue.Int = 2;
if (var != NULL)
{
UCVarValue v = var->GetGenericRep(CVAR_Int);
if (v.Int == 3) var->SetGenericRep(newvalue, CVAR_Int);
}
}
} }
} }
} }

View file

@ -5419,7 +5419,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
} }
else else
{ {
return Level->Players[args[0]]->air_finished - Level->time; return Level->Players[args[0]]->air_finished - Level->maptime;
} }
} }
@ -5431,7 +5431,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
} }
else else
{ {
Level->Players[args[0]]->air_finished = args[1] + Level->time; Level->Players[args[0]]->air_finished = args[1] + Level->maptime;
return 1; return 1;
} }
} }

View file

@ -4330,7 +4330,7 @@ bool AActor::UpdateWaterLevel(bool dosplash)
else if (oldlevel == 3 && waterlevel < 3) else if (oldlevel == 3 && waterlevel < 3)
{ {
// Our head just came up. // Our head just came up.
if (player->air_finished > Level->time) if (player->air_finished > Level->maptime)
{ {
// We hadn't run out of air yet. // We hadn't run out of air yet.
S_Sound(this, CHAN_VOICE, "*surface", 1, ATTN_NORM); S_Sound(this, CHAN_VOICE, "*surface", 1, ATTN_NORM);

View file

@ -960,8 +960,7 @@ void FLevelLocals::Serialize(FSerializer &arc, bool hubload)
("scrolls", Scrolls) ("scrolls", Scrolls)
("automap", automap) ("automap", automap)
("interpolator", interpolator) ("interpolator", interpolator)
("frozenstate", frozenstate) ("frozenstate", frozenstate);
("sndseqlisthead", SequenceListHead);
// Hub transitions must keep the current total time // Hub transitions must keep the current total time
@ -1003,6 +1002,8 @@ void FLevelLocals::Serialize(FSerializer &arc, bool hubload)
canvasTextureInfo.Serialize(arc); canvasTextureInfo.Serialize(arc);
SerializePlayers(arc, hubload); SerializePlayers(arc, hubload);
SerializeSounds(arc); SerializeSounds(arc);
arc("sndseqlisthead", SequenceListHead);
// Regenerate some data that wasn't saved // Regenerate some data that wasn't saved
if (arc.isReading()) if (arc.isReading())

View file

@ -80,8 +80,8 @@ protected:
int GetTitleBarHeight() const; int GetTitleBarHeight() const;
static const int MINIMUM_WIDTH = 320; static const int MINIMUM_WIDTH = 640;
static const int MINIMUM_HEIGHT = 200; static const int MINIMUM_HEIGHT = 400;
}; };
class SystemGLFrameBuffer : public SystemBaseFrameBuffer class SystemGLFrameBuffer : public SystemBaseFrameBuffer

View file

@ -32,16 +32,16 @@
extern bool setsizeneeded; extern bool setsizeneeded;
EXTERN_CVAR(Int, vid_aspect) EXTERN_CVAR(Int, vid_aspect)
CUSTOM_CVAR(Int, vid_scale_customwidth, 320, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(Int, vid_scale_customwidth, 640, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
if (self < 320) if (self < 640)
self = 320; self = 640;
setsizeneeded = true; setsizeneeded = true;
} }
CUSTOM_CVAR(Int, vid_scale_customheight, 200, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(Int, vid_scale_customheight, 400, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
if (self < 200) if (self < 400)
self = 200; self = 400;
setsizeneeded = true; setsizeneeded = true;
} }
CVAR(Bool, vid_scale_customlinear, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, vid_scale_customlinear, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -66,8 +66,8 @@ namespace
// isValid, isLinear, GetScaledWidth(), GetScaledHeight(), isScaled43, isCustom // isValid, isLinear, GetScaledWidth(), GetScaledHeight(), isScaled43, isCustom
{ true, false, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 0 - Native { true, false, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 0 - Native
{ true, true, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 1 - Native (Linear) { true, true, [](uint32_t Width)->uint32_t { return Width; }, [](uint32_t Height)->uint32_t { return Height; }, false, false }, // 1 - Native (Linear)
{ true, false, [](uint32_t Width)->uint32_t { return 320; }, [](uint32_t Height)->uint32_t { return 200; }, true, false }, // 2 - 320x200 { true, false, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true, false }, // 2 - 640x400 (formerly 320x200)
{ true, false, [](uint32_t Width)->uint32_t { return 640; }, [](uint32_t Height)->uint32_t { return 400; }, true, false }, // 3 - 640x400 { true, true, [](uint32_t Width)->uint32_t { return 960; }, [](uint32_t Height)->uint32_t { return 600; }, true, false }, // 3 - 960x600 (formerly 640x400)
{ true, true, [](uint32_t Width)->uint32_t { return 1280; }, [](uint32_t Height)->uint32_t { return 800; }, true, false }, // 4 - 1280x800 { true, true, [](uint32_t Width)->uint32_t { return 1280; }, [](uint32_t Height)->uint32_t { return 800; }, true, false }, // 4 - 1280x800
{ true, true, [](uint32_t Width)->uint32_t { return vid_scale_customwidth; }, [](uint32_t Height)->uint32_t { return vid_scale_customheight; }, true, true }, // 5 - Custom { true, true, [](uint32_t Width)->uint32_t { return vid_scale_customwidth; }, [](uint32_t Height)->uint32_t { return vid_scale_customheight; }, true, true }, // 5 - Custom
}; };

View file

@ -87,9 +87,6 @@ CUSTOM_CVAR(Bool, gl_texture_usehires, true, CVAR_ARCHIVE|CVAR_NOINITCALL)
CVAR(Bool, gl_precache, false, CVAR_ARCHIVE) CVAR(Bool, gl_precache, false, CVAR_ARCHIVE)
CVAR(Bool, gl_trimsprites, true, CVAR_ARCHIVE);
//========================================================================== //==========================================================================
// //
// Sprite CVARs // Sprite CVARs

View file

@ -129,8 +129,6 @@ void PolyRenderer::RenderActorView(AActor *actor, bool drawpsprites, bool dontma
PolyMaskedCycles.Reset(); PolyMaskedCycles.Reset();
PolyDrawerWaitCycles.Reset(); PolyDrawerWaitCycles.Reset();
NetUpdate();
DontMapLines = dontmaplines; DontMapLines = dontmaplines;
R_SetupFrame(Viewpoint, Viewwindow, actor); R_SetupFrame(Viewpoint, Viewwindow, actor);
@ -188,8 +186,6 @@ void PolyRenderer::RenderActorView(AActor *actor, bool drawpsprites, bool dontma
if (Viewpoint.camera) if (Viewpoint.camera)
Viewpoint.camera->renderflags = savedflags; Viewpoint.camera->renderflags = savedflags;
NetUpdate();
} }
void PolyRenderer::RenderRemainingPlayerSprites() void PolyRenderer::RenderRemainingPlayerSprites()

View file

@ -70,9 +70,6 @@ namespace swrenderer
curline = ds->curline; curline = ds->curline;
m3DFloor = clip3DFloor; m3DFloor = clip3DFloor;
if (Thread->MainThread)
NetUpdate();
frontsector = curline->frontsector; frontsector = curline->frontsector;
backsector = curline->backsector; backsector = curline->backsector;

View file

@ -546,9 +546,6 @@ namespace swrenderer
this->additive = additive; this->additive = additive;
this->alpha = alpha; this->alpha = alpha;
if (Thread->MainThread)
NetUpdate();
Thread->PrepareTexture(pic, DefaultRenderStyle()); // Get correct render style? Shaded won't get here. Thread->PrepareTexture(pic, DefaultRenderStyle()); // Get correct render style? Shaded won't get here.
if (rw_pic->GetHeight() != 1 << rw_pic->GetHeightBits()) if (rw_pic->GetHeight() != 1 << rw_pic->GetHeightBits())

View file

@ -143,7 +143,5 @@ namespace swrenderer
renderer.Render(this, xscale, yscale, alpha, additive, masked, colormap, tex); renderer.Render(this, xscale, yscale, alpha, additive, masked, colormap, tex);
} }
} }
if (thread->MainThread)
NetUpdate();
} }
} }

View file

@ -458,14 +458,8 @@ namespace swrenderer
int prevuniq2 = CurrentPortalUniq; int prevuniq2 = CurrentPortalUniq;
CurrentPortalUniq = prevuniq; CurrentPortalUniq = prevuniq;
if (Thread->MainThread)
NetUpdate();
Thread->TranslucentPass->Render(); // this is required since with portals there often will be cases when more than 80% of the view is inside a portal. Thread->TranslucentPass->Render(); // this is required since with portals there often will be cases when more than 80% of the view is inside a portal.
if (Thread->MainThread)
NetUpdate();
Thread->Clip3D->LeaveSkybox(); // pop 3D floor height map Thread->Clip3D->LeaveSkybox(); // pop 3D floor height map
CurrentPortalUniq = prevuniq2; CurrentPortalUniq = prevuniq2;

View file

@ -155,8 +155,6 @@ namespace swrenderer
CameraLight::Instance()->SetCamera(MainThread()->Viewport->viewpoint, MainThread()->Viewport->RenderTarget, actor); CameraLight::Instance()->SetCamera(MainThread()->Viewport->viewpoint, MainThread()->Viewport->RenderTarget, actor);
MainThread()->Viewport->SetupFreelook(); MainThread()->Viewport->SetupFreelook();
NetUpdate();
this->dontmaplines = dontmaplines; this->dontmaplines = dontmaplines;
R_UpdateFuzzPosFrameStart(); R_UpdateFuzzPosFrameStart();
@ -289,9 +287,6 @@ namespace swrenderer
thread->OpaquePass->RenderScene(thread->Viewport->Level()); thread->OpaquePass->RenderScene(thread->Viewport->Level());
thread->Clip3D->ResetClip(); // reset clips (floor/ceiling) thread->Clip3D->ResetClip(); // reset clips (floor/ceiling)
if (thread->MainThread)
NetUpdate();
if (viewactive) if (viewactive)
{ {
thread->PlaneList->Render(); thread->PlaneList->Render();
@ -299,13 +294,7 @@ namespace swrenderer
thread->Portal->RenderPlanePortals(); thread->Portal->RenderPlanePortals();
thread->Portal->RenderLinePortals(); thread->Portal->RenderLinePortals();
if (thread->MainThread)
NetUpdate();
thread->TranslucentPass->Render(); thread->TranslucentPass->Render();
if (thread->MainThread)
NetUpdate();
} }
DrawerThreads::Execute(thread->DrawQueue); DrawerThreads::Execute(thread->DrawQueue);

View file

@ -530,8 +530,5 @@ namespace swrenderer
drawerargs.DrawMaskedColumn(thread, x, iscale, pic, frac + xiscale / 2, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, RenderStyle, false); drawerargs.DrawMaskedColumn(thread, x, iscale, pic, frac + xiscale / 2, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, RenderStyle, false);
frac += xiscale; frac += xiscale;
} }
if (thread->MainThread)
NetUpdate();
} }
} }

View file

@ -369,8 +369,5 @@ namespace swrenderer
} }
} }
} }
if (thread->MainThread)
NetUpdate();
} }
} }

View file

@ -216,8 +216,8 @@ void DFrameBuffer::Update()
int initialHeight = GetClientHeight(); int initialHeight = GetClientHeight();
int clientWidth = ViewportScaledWidth(initialWidth, initialHeight); int clientWidth = ViewportScaledWidth(initialWidth, initialHeight);
int clientHeight = ViewportScaledHeight(initialWidth, initialHeight); int clientHeight = ViewportScaledHeight(initialWidth, initialHeight);
if (clientWidth < 320) clientWidth = 320; if (clientWidth < 640) clientWidth = 640;
if (clientHeight < 200) clientHeight = 200; if (clientHeight < 400) clientHeight = 400;
if (clientWidth > 0 && clientHeight > 0 && (GetWidth() != clientWidth || GetHeight() != clientHeight)) if (clientWidth > 0 && clientHeight > 0 && (GetWidth() != clientWidth || GetHeight() != clientHeight))
{ {
SetVirtualSize(clientWidth, clientHeight); SetVirtualSize(clientWidth, clientHeight);

View file

@ -65,7 +65,7 @@ const char *GetVersionString();
// Version stored in the ini's [LastRun] section. // Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to // Bump it if you made some configuration change that you want to
// be able to migrate in FGameConfigFile::DoGlobalSetup(). // be able to migrate in FGameConfigFile::DoGlobalSetup().
#define LASTRUNVERSION "216" #define LASTRUNVERSION "217"
// Protocol version used in demos. // Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones. // Bump it if you change existing DEM_ commands or add new ones.

View file

@ -525,8 +525,8 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
else else
{ {
mmi->ptMinTrackSize.x = 320; mmi->ptMinTrackSize.x = 640;
mmi->ptMinTrackSize.y = 200; mmi->ptMinTrackSize.y = 400;
} }
return 0; return 0;
} }

View file

@ -807,7 +807,7 @@ OptionValue Contrast
{ {
0.0, "$OPTVAL_OFF" 0.0, "$OPTVAL_OFF"
1.0, "$OPTVAL_ON" 1.0, "$OPTVAL_ON"
2.0, "$OPTVAL_SMOOTH" 2.0, "$OPTVAL_SMOOTH_1"
} }
OptionValue Fuzziness OptionValue Fuzziness
@ -2133,8 +2133,8 @@ OptionValue ScaleModes
{ {
0, "$OPTVAL_SCALENEAREST" 0, "$OPTVAL_SCALENEAREST"
1, "$OPTVAL_SCALELINEAR" 1, "$OPTVAL_SCALELINEAR"
2, "320x200" 2, "640x400"
3, "640x400" 3, "960x600"
4, "1280x800" 4, "1280x800"
5, "$OPTVAL_CUSTOM" 5, "$OPTVAL_CUSTOM"
} }
@ -2376,7 +2376,7 @@ OptionValue "Particles"
{ {
0, "$OPTVAL_SQUARE" 0, "$OPTVAL_SQUARE"
1, "$OPTVAL_ROUND" 1, "$OPTVAL_ROUND"
2, "$OPTVAL_SMOOTH" 2, "$OPTVAL_SMOOTH_2"
} }
OptionValue "HqResizeModes" OptionValue "HqResizeModes"
@ -2486,7 +2486,6 @@ OptionMenu "GLTextureGLOptions" protected
Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff" Option "$GLTEXMNU_RESIZESPR", gl_texture_hqresize_sprites, "OnOff"
Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff" Option "$GLTEXMNU_RESIZEFNT", gl_texture_hqresize_fonts, "OnOff"
Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo" Option "$GLTEXMNU_PRECACHETEX", gl_precache, "YesNo"
Option "$GLTEXMNU_TRIMSPREDGE", gl_trimsprites, "OnOff"
Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo" Option "$GLTEXMNU_SORTDRAWLIST", gl_sort_textures, "YesNo"
Class "GLTextureGLOptions" Class "GLTextureGLOptions"
} }

View file

@ -80,6 +80,7 @@ class OptionMenuItem : MenuItemBase
override int GetIndent() override int GetIndent()
{ {
if (mCentered) return 0; if (mCentered) return 0;
if (screen.GetWidth() < 640) return screen.GetWidth() / 2;
return Menu.OptionWidth(Stringtable.Localize(mLabel)); return Menu.OptionWidth(Stringtable.Localize(mLabel));
} }
@ -179,7 +180,7 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
override bool Activate() override bool Activate()
{ {
// This needs to perform a few checks to prevent abuse by malicious modders. // This needs to perform a few checks to prevent abuse by malicious modders.
if (GetClass() != "OptionMenuItemSafeCommand") if (GetClass() != "OptionMenuItemSafeCommand")
{ {
let m = OptionMenu(Menu.GetCurrentMenu()); let m = OptionMenu(Menu.GetCurrentMenu());
@ -188,6 +189,7 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
// don't execute if this item cannot be found in the current menu. // don't execute if this item cannot be found in the current menu.
if (m.GetItem(mAction) != self) return false; if (m.GetItem(mAction) != self) return false;
} }
else mUnsafe = false;
Menu.MenuSound("menu/choose"); Menu.MenuSound("menu/choose");
DoCommand(ccmd, mUnsafe); DoCommand(ccmd, mUnsafe);
if (mCloseOnSelect) if (mCloseOnSelect)

View file

@ -599,7 +599,7 @@ class BaseStatusBar native ui
if(CPlayer.mo.waterlevel < 3) if(CPlayer.mo.waterlevel < 3)
return Level.airsupply; return Level.airsupply;
else else
return max(CPlayer.air_finished - Level.time, 0); return max(CPlayer.air_finished - Level.maptime, 0);
} }
int GetSelectedInventoryAmount() int GetSelectedInventoryAmount()

View file

@ -337,7 +337,6 @@ object CFlameFloor
// Wraithverge // Wraithverge
flickerlight GHOST flickerlight GHOST
{ {
attenuate 1
color 1.0 1.0 1.0 color 1.0 1.0 1.0
size 84 size 84
secondarysize 78 secondarysize 78
@ -347,13 +346,13 @@ flickerlight GHOST
object HolyMissile object HolyMissile
{ {
frame SPIRP { light GHOST } //frame SPIRP { light GHOST }
} }
object HolySpirit object HolySpirit
{ {
frame SPIRA { light GHOST } //frame SPIRA { light GHOST }
frame SPIRB { light GHOST } //frame SPIRB { light GHOST }
} }
// Mage wand // Mage wand