mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-17 08:00:51 +00:00
83936bf5eb
This reverts commite878c5bab8
. Revert "SW: Use Q16.16 for horiz." This reverts commitf07a0ae01e
. Revert "SW: Use Q16.16 for angle." This reverts commit1ecc74c2ec
. Revert "SW: Minor repairs for Q16.16 implementation." This reverts commitd78d046bad
. Revert "SW: Process input at frame rate." This reverts commitc162014dab
. Revert "SW: Amendments to accommodate changes in master." This reverts commiteaa51138ad
. Revert "SW: Fix incorrectly declared function input type." This reverts commit1cdd5b08d8
. Revert "SW: Amend scaleAdjustmentToInterval() with correct value for SW." This reverts commitd4dd737cd5
. Revert "SW: Refinements to new input code." This reverts commit5ebc65a1fb
. Revert "SW: Adjust look and snap up/down keys and slightly tune PLAYER_TURN_AMOUNT." This reverts commit2852536dbf
. Revert "SW: Get PLAYER_TURN_SCALE to be just right." This reverts commit4630c8a0b7
. Revert "SW: Make map follow mode work better." This reverts commit8e94c48eff
. Revert "SW: Remove line accidentally left from 'MoveScrollMode2D()'." This reverts commit5db8047b41
. Revert "Fix multiplayer desync after the change to q16 angle and horiz." This reverts commit3bc46078b8
. Revert "SW: Revert commented out horiz->q16horiz renames in DSPRINTF strings" This reverts commit537313f620
. Revert "sw/src/draw.cpp:drawscreen: We can set the pp->si* fields just once," This reverts commitd2e9595980
. Revert "sw/src/game.cpp:LoadLevel: Rename q16ang -> ang" This reverts commita178961a3e
. Revert "SW: Minor tweaks." This reverts commit377ba68344
. Revert "SW: Further refine turning and optimise horizon adjustment." This reverts commit039022d9ac
. Revert "SW: Don't process input at frame rate if ScrollMode2D is true." This reverts commit1aa1e62c4d
. Revert "SW: Use a bit more Q16.16 in places." This reverts commit40ca656f38
. Revert "SW: Use the old interpolation path in drawscreen if player is dead" This reverts commit2d73466425
. Revert "SW: Smooth out 180 degree turn landing and replace some fix16_min/max with fix16_clamp." This reverts commit0996e87f79
. Revert "Change Next/Previous Weapon button handling for Shadow Warrior." This reverts commitf6b8ca6a22
. Revert "SW: Make "Center_View" key return smoothly." This reverts commit23c401fbc2
. Revert "SW: Use the old interpolation path in drawscreen if player is dead" This reverts commit43ec16eb55
. Revert "Interpolation fixes for SW:" This reverts commitac8a7ecfbd
. Revert "SW: Reset the number of interpolations on level load" This reverts commit04bf8499e7
. Revert "Another change modifying saved game format in SW:" This reverts commite80888523e
. Revert "SW: Interpolate sector objects in non-demo, single player games." This reverts commit996ab77cf4
. Revert "- fixed merge errors in SW." This reverts commitb8cfa94568
. Revert "- fix interpolation stutters when opening console for SW." This reverts commit99fdbfb6cb
. Revert "- reset buttonMap button states after returning from pause for SW (stops keys acting stuck down if down prior to pausing)." This reverts commit693b6955da
. Revert "SW: fix stupid input scaling bug" This reverts commit1c79e6e17c
. Revert "SW: Make vehicle input better." This reverts commit670a53c402
. Revert "SW: Change fix16_from_float() to fix16_from_int() that was changed in4630c8a0b7
but should have been reverted in 377ba68344e34495638c6fa7685ff78c9a0ed6f8." This reverts commit423c9da071
. Revert "SW: Remove ScrollMode2D extern boolean and move into PLAYERp struct." This reverts commit31eb55c1fa
.
114 lines
2.9 KiB
C++
114 lines
2.9 KiB
C++
//-------------------------------------------------------------------------
|
|
/*
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
*/
|
|
//-------------------------------------------------------------------------
|
|
|
|
#include "ns.h"
|
|
|
|
#include "compat.h"
|
|
#include "pragmas.h"
|
|
|
|
#include "interp.h"
|
|
|
|
BEGIN_SW_NS
|
|
|
|
#define MAXINTERPOLATIONS 1024
|
|
int numinterpolations = 0, startofdynamicinterpolations = 0;
|
|
int oldipos[MAXINTERPOLATIONS];
|
|
int bakipos[MAXINTERPOLATIONS];
|
|
int *curipos[MAXINTERPOLATIONS];
|
|
|
|
void setinterpolation(int *posptr)
|
|
{
|
|
int i;
|
|
|
|
if (numinterpolations >= MAXINTERPOLATIONS)
|
|
return;
|
|
|
|
for (i = numinterpolations - 1; i >= 0; i--)
|
|
{
|
|
if (curipos[i] == posptr)
|
|
return;
|
|
}
|
|
|
|
curipos[numinterpolations] = posptr;
|
|
oldipos[numinterpolations] = *posptr;
|
|
numinterpolations++;
|
|
}
|
|
|
|
void stopinterpolation(int *posptr)
|
|
{
|
|
int i;
|
|
|
|
for (i = numinterpolations - 1; i >= startofdynamicinterpolations; i--)
|
|
{
|
|
if (curipos[i] == posptr)
|
|
{
|
|
numinterpolations--;
|
|
oldipos[i] = oldipos[numinterpolations];
|
|
bakipos[i] = bakipos[numinterpolations];
|
|
curipos[i] = curipos[numinterpolations];
|
|
}
|
|
}
|
|
}
|
|
|
|
void updateinterpolations(void) // Stick at beginning of domovethings
|
|
{
|
|
int i;
|
|
|
|
for (i = numinterpolations - 1; i >= 0; i--)
|
|
oldipos[i] = *curipos[i];
|
|
}
|
|
|
|
// must call restore for every do interpolations
|
|
// make sure you don't exit
|
|
void dointerpolations(int smoothratio) // Stick at beginning of drawscreen
|
|
{
|
|
int i, j, odelta, ndelta;
|
|
|
|
ndelta = 0;
|
|
j = 0;
|
|
|
|
for (i = numinterpolations - 1; i >= 0; i--)
|
|
{
|
|
bakipos[i] = *curipos[i];
|
|
|
|
odelta = ndelta;
|
|
ndelta = (*curipos[i]) - oldipos[i];
|
|
|
|
if (odelta != ndelta)
|
|
j = mulscale16(ndelta, smoothratio);
|
|
|
|
*curipos[i] = oldipos[i] + j;
|
|
}
|
|
}
|
|
|
|
void restoreinterpolations(void) // Stick at end of drawscreen
|
|
{
|
|
int i;
|
|
|
|
for (i = numinterpolations - 1; i >= 0; i--)
|
|
*curipos[i] = bakipos[i];
|
|
}
|
|
END_SW_NS
|