mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-02 06:52:58 +00:00
- WH: interpolation
This commit is contained in:
parent
fc5e0ae229
commit
095391ed3a
3 changed files with 39 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "ns.h"
|
#include "ns.h"
|
||||||
#include "wh.h"
|
#include "wh.h"
|
||||||
|
#include "interpolate.h"
|
||||||
|
|
||||||
BEGIN_WH_NS
|
BEGIN_WH_NS
|
||||||
|
|
||||||
|
@ -42,7 +43,22 @@ int setanimation(int index, int thegoal, int thevel, int theacc, int type)
|
||||||
gAnm.vel = thevel;
|
gAnm.vel = thevel;
|
||||||
gAnm.acc = theacc;
|
gAnm.acc = theacc;
|
||||||
gAnm.type = (byte)type;
|
gAnm.type = (byte)type;
|
||||||
// todo: setinterpolation
|
|
||||||
|
switch (gAnm.type)
|
||||||
|
{
|
||||||
|
case WALLX:
|
||||||
|
StartInterpolation(gAnm.id, Interp_Wall_X);
|
||||||
|
break;
|
||||||
|
case WALLY:
|
||||||
|
StartInterpolation(gAnm.id, Interp_Wall_Y);
|
||||||
|
break;
|
||||||
|
case FLOORZ:
|
||||||
|
StartInterpolation(gAnm.id, Interp_Sect_Floorz);
|
||||||
|
break;
|
||||||
|
case CEILZ:
|
||||||
|
StartInterpolation(gAnm.id, Interp_Sect_Ceilingz);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (j == gAnimationCount) gAnimationCount++;
|
if (j == gAnimationCount) gAnimationCount++;
|
||||||
|
|
||||||
|
@ -90,7 +106,22 @@ void doanimations()
|
||||||
|
|
||||||
if (j == gAnm.goal)
|
if (j == gAnm.goal)
|
||||||
{
|
{
|
||||||
// todo: stopinterpolation
|
switch (gAnm.type)
|
||||||
|
{
|
||||||
|
case WALLX:
|
||||||
|
StopInterpolation(gAnm.id, Interp_Wall_X);
|
||||||
|
break;
|
||||||
|
case WALLY:
|
||||||
|
StopInterpolation(gAnm.id, Interp_Wall_Y);
|
||||||
|
break;
|
||||||
|
case FLOORZ:
|
||||||
|
StopInterpolation(gAnm.id, Interp_Sect_Floorz);
|
||||||
|
break;
|
||||||
|
case CEILZ:
|
||||||
|
StopInterpolation(gAnm.id, Interp_Sect_Ceilingz);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
gAnimationCount--;
|
gAnimationCount--;
|
||||||
if (i != gAnimationCount)
|
if (i != gAnimationCount)
|
||||||
gAnm = gAnimationData[gAnimationCount];
|
gAnm = gAnimationData[gAnimationCount];
|
||||||
|
|
|
@ -236,7 +236,7 @@ boolean prepareboard(const char* fname) {
|
||||||
killcnt = 0;
|
killcnt = 0;
|
||||||
kills = 0;
|
kills = 0;
|
||||||
expgained = 0;
|
expgained = 0;
|
||||||
// numinterpolations=0;
|
ClearInterpolations();
|
||||||
|
|
||||||
// the new mirror code
|
// the new mirror code
|
||||||
floormirrorcnt = 0;
|
floormirrorcnt = 0;
|
||||||
|
|
|
@ -936,8 +936,7 @@ void animatetags(int nPlayer) {
|
||||||
dragpoint((short) j, wall[j].x + dragxdir[i], wall[j].y + dragydir[i]);
|
dragpoint((short) j, wall[j].x + dragxdir[i], wall[j].y + dragydir[i]);
|
||||||
j = sector[dasector].floorz;
|
j = sector[dasector].floorz;
|
||||||
|
|
||||||
#pragma message ("setinterpolation")
|
StartInterpolation(dasector, Interp_Sect_Floorz);
|
||||||
//game.pInt.setceilinterpolate(dasector, sector[dasector]);
|
|
||||||
sector[dasector].floorz = dragfloorz[i] + bsin(PlayClock << 4, -3);
|
sector[dasector].floorz = dragfloorz[i] + bsin(PlayClock << 4, -3);
|
||||||
|
|
||||||
if (plr.sector == dasector) {
|
if (plr.sector == dasector) {
|
||||||
|
@ -971,6 +970,8 @@ void animatetags(int nPlayer) {
|
||||||
Point out = rotatepoint(swingdoor[i].x[0], swingdoor[i].y[0], swingdoor[i].x[k],
|
Point out = rotatepoint(swingdoor[i].x[0], swingdoor[i].y[0], swingdoor[i].x[k],
|
||||||
swingdoor[i].y[k], (short) swingdoor[i].ang);
|
swingdoor[i].y[k], (short) swingdoor[i].ang);
|
||||||
|
|
||||||
|
StartInterpolation(swingdoor[i].wall[k], Interp_Wall_X);
|
||||||
|
StartInterpolation(swingdoor[i].wall[k], Interp_Wall_Y);
|
||||||
dragpoint((short)swingdoor[i].wall[k], out.getX(), out.getY());
|
dragpoint((short)swingdoor[i].wall[k], out.getX(), out.getY());
|
||||||
}
|
}
|
||||||
if (swingdoor[i].anginc != 0) {
|
if (swingdoor[i].anginc != 0) {
|
||||||
|
@ -988,6 +989,8 @@ void animatetags(int nPlayer) {
|
||||||
Point out = rotatepoint(swingdoor[i].x[0], swingdoor[i].y[0], swingdoor[i].x[k],
|
Point out = rotatepoint(swingdoor[i].x[0], swingdoor[i].y[0], swingdoor[i].x[k],
|
||||||
swingdoor[i].y[k], (short) swingdoor[i].ang);
|
swingdoor[i].y[k], (short) swingdoor[i].ang);
|
||||||
|
|
||||||
|
StartInterpolation(swingdoor[i].wall[k], Interp_Wall_X);
|
||||||
|
StartInterpolation(swingdoor[i].wall[k], Interp_Wall_Y);
|
||||||
dragpoint((short)swingdoor[i].wall[k], out.getX(), out.getY());
|
dragpoint((short)swingdoor[i].wall[k], out.getX(), out.getY());
|
||||||
}
|
}
|
||||||
swingdoor[i].anginc = -swingdoor[i].anginc;
|
swingdoor[i].anginc = -swingdoor[i].anginc;
|
||||||
|
|
Loading…
Reference in a new issue