| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- /*
- ** Command & Conquer Generals Zero Hour(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program 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 3 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, see <http://www.gnu.org/licenses/>.
- */
- ////////////////////////////////////////////////////////////////////////////////
- // //
- // (c) 2001-2003 Electronic Arts Inc. //
- // //
- ////////////////////////////////////////////////////////////////////////////////
- // FILE: ProcessAnimateWindow.h /////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- //
- // Electronic Arts Pacific.
- //
- // Confidential Information
- // Copyright (C) 2002 - All Rights Reserved
- //
- //-----------------------------------------------------------------------------
- //
- // created: Mar 2002
- //
- // Filename: ProcessAnimateWindow.h
- //
- // author: Chris Huybregts
- //
- // purpose: If a new animation is wanted to be added for the windows, All you
- // have to do is create a new class derived from ProcessAnimateWindow.
- // Then setup each of the virtual classes to process an AnimateWindow
- // class. The Update adn reverse functions get called every frame
- // by the shell and will continue to process the AdminWin until the
- // isFinished flag on the adminWin is set to true.
- //
- //-----------------------------------------------------------------------------
- ///////////////////////////////////////////////////////////////////////////////
- #pragma once
- #ifndef __PROCESSANIMATEWINDOW_H_
- #define __PROCESSANIMATEWINDOW_H_
- //-----------------------------------------------------------------------------
- // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // USER INCLUDES //////////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- #include "Lib/BaseType.h"
- //-----------------------------------------------------------------------------
- // FORWARD REFERENCES /////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- class AnimateWindow;
- class GameWindow;
- //-----------------------------------------------------------------------------
- // TYPE DEFINES ///////////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindow( void ){};
- virtual ~ProcessAnimateWindow( void ){};
- virtual void initAnimateWindow( AnimateWindow *animWin ) = 0;
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 ) = 0;
- virtual Bool updateAnimateWindow( AnimateWindow *animWin ) = 0;
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin ) = 0;
- virtual void setMaxDuration(UnsignedInt maxDuration) { }
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromRight : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromRight( void );
- virtual ~ProcessAnimateWindowSlideFromRight( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromLeft : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromLeft( void );
- virtual ~ProcessAnimateWindowSlideFromLeft( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromTop : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromTop( void );
- virtual ~ProcessAnimateWindowSlideFromTop( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromTopFast : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromTopFast( void );
- virtual ~ProcessAnimateWindowSlideFromTopFast( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromBottom : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromBottom( void );
- virtual ~ProcessAnimateWindowSlideFromBottom( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSpiral : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSpiral( void );
- virtual ~ProcessAnimateWindowSpiral( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Real m_deltaTheta;
- Int m_maxR;
- };
- //-----------------------------------------------------------------------------
- class ProcessAnimateWindowSlideFromBottomTimed : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromBottomTimed( void );
- virtual ~ProcessAnimateWindowSlideFromBottomTimed( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- virtual void setMaxDuration(UnsignedInt maxDuration) { m_maxDuration = maxDuration; }
- private:
- UnsignedInt m_maxDuration;
- };
- class ProcessAnimateWindowSlideFromRightFast : public ProcessAnimateWindow
- {
- public:
- ProcessAnimateWindowSlideFromRightFast( void );
- virtual ~ProcessAnimateWindowSlideFromRightFast( void );
- virtual void initAnimateWindow( AnimateWindow *animWin );
- virtual void initReverseAnimateWindow( AnimateWindow *animWin, UnsignedInt maxDelay = 0 );
- virtual Bool updateAnimateWindow( AnimateWindow *animWin );
- virtual Bool reverseAnimateWindow( AnimateWindow *animWin );
- private:
- Coord2D m_maxVel; // top speed windows travel in x and y
- Int m_slowDownThreshold; // when widnows get this close to their resting
- // positions they start to slow down
- Real m_slowDownRatio; // how fast the windows slow down (smaller slows quicker)
- Real m_speedUpRatio; // how fast the windows speed up
- };
- //-----------------------------------------------------------------------------
- // INLINING ///////////////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- //-----------------------------------------------------------------------------
- // EXTERNALS //////////////////////////////////////////////////////////////////
- //-----------------------------------------------------------------------------
- #endif // __PROCESSANIMATEWINDOW_H_
|