From 7a9eca2cca5490c1d1fc710ba5714629c78dc3f7 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 13 Aug 2001 20:51:44 +0000 Subject: [PATCH] --- source/projectl/projectl.cpp | 18 ++++++++++++++++-- source/projectl/projectl.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/source/projectl/projectl.cpp b/source/projectl/projectl.cpp index f041b7ea6..e854bf815 100644 --- a/source/projectl/projectl.cpp +++ b/source/projectl/projectl.cpp @@ -516,6 +516,8 @@ void CPlayerProjectile::init() m_extension = 0; m_frame = 0; m_reversed = 0; + m_highResX = 0; + m_highResY = 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -689,8 +691,20 @@ void CPlayerProjectile::think(int _frames) } else { - Pos.vx += ( _frames * 5 * rcos( m_heading ) ) >> 12; - Pos.vy += ( _frames * 5 * rsin( m_heading ) ) >> 12; + m_highResX += ( _frames * ( 5 << 8 ) * rcos( m_heading ) ) >> 12; + m_highResY += ( _frames * ( 5 << 8 ) * rsin( m_heading ) ) >> 12; + + if ( abs( m_highResX ) > 256 ) + { + Pos.vx += m_highResX >> 8; + m_highResX -= ( m_highResX >> 8 ) << 8; + } + + if ( abs( m_highResY ) > 256 ) + { + Pos.vy += m_highResY >> 8; + m_highResY -= ( m_highResY >> 8 ) << 8; + } } break; diff --git a/source/projectl/projectl.h b/source/projectl/projectl.h index 037722773..d7fccdcaa 100644 --- a/source/projectl/projectl.h +++ b/source/projectl/projectl.h @@ -148,6 +148,7 @@ protected: s16 m_vertVelocity; u8 m_bounceCount; u8 m_hitTarget; + s32 m_highResX, m_highResY; };