mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
sw/src/draw.cpp:ResizeView: Make map zooming less dependent
on the frame rate git-svn-id: https://svn.eduke32.com/eduke32@8700 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/sw/src/draw.cpp
This commit is contained in:
parent
93eea97477
commit
d98bf9ba62
1 changed files with 7 additions and 7 deletions
|
@ -1035,6 +1035,8 @@ post_analyzesprites(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static ClockTicks mapzoomclock;
|
||||||
|
|
||||||
void
|
void
|
||||||
ResizeView(PLAYERp pp)
|
ResizeView(PLAYERp pp)
|
||||||
{
|
{
|
||||||
|
@ -1043,15 +1045,13 @@ ResizeView(PLAYERp pp)
|
||||||
|
|
||||||
if (dimensionmode == 2 || dimensionmode == 5 || dimensionmode == 6)
|
if (dimensionmode == 2 || dimensionmode == 5 || dimensionmode == 6)
|
||||||
{
|
{
|
||||||
if (inputState.GetKeyStatus(KEYSC_DASH)||inputState.GetKeyStatus(KEYSC_GMINUS))
|
int32_t timepassed = (int32_t)(totalclock - mapzoomclock);
|
||||||
{
|
mapzoomclock += timepassed;
|
||||||
if ((zoom -= (zoom >> 4)) < 48) zoom = 48;
|
if (inputState.GetKeyStatus(KEYSC_DASH)||inputState.GetKeyStatus(KEYSC_GMINUS))
|
||||||
}
|
zoom = max<int32_t>(zoom - mulscale7(timepassed * synctics, zoom), 48);
|
||||||
|
|
||||||
if (inputState.GetKeyStatus(KEYSC_EQUAL)||inputState.GetKeyStatus(KEYSC_GPLUS))
|
if (inputState.GetKeyStatus(KEYSC_EQUAL)||inputState.GetKeyStatus(KEYSC_GPLUS))
|
||||||
{
|
zoom = min<int32_t>(zoom + mulscale7(timepassed * synctics, zoom), 4096);
|
||||||
if ((zoom += (zoom >> 4)) > 4096) zoom = 4096;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inputState.GetKeyStatus(KEYSC_ESC))
|
if (inputState.GetKeyStatus(KEYSC_ESC))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue