CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

MOUSE.H (4818B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header: /CounterStrike/MOUSE.H 1     3/03/97 10:25a Joe_bostic $ */
     17 /***********************************************************************************************
     18  ***              C O N F I D E N T I A L  ---  W E S T W O O D  S T U D I O S               ***
     19  ***********************************************************************************************
     20  *                                                                                             *
     21  *                 Project Name : Command & Conquer                                            *
     22  *                                                                                             *
     23  *                    File Name : MOUSE.H                                                      *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : 12/15/94                                                     *
     28  *                                                                                             *
     29  *                  Last Update : December 15, 1994 [JLB]                                      *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef MOUSE_H
     36 #define MOUSE_H
     37 
     38 #include	"stage.h"
     39 #include	"scroll.h"
     40 
     41 class MouseClass: public ScrollClass
     42 {
     43 	public:
     44 		MouseClass(void);
     45 		MouseClass(NoInitClass const & x) : ScrollClass(x) {};
     46 
     47 		/*
     48 		** Initialization
     49 		*/
     50 		virtual void One_Time(void);							// One-time inits
     51 		virtual void Init_Clear(void);						// Clears all to known state
     52 
     53 		virtual void AI(KeyNumType &input, int x, int y);
     54 		virtual bool Override_Mouse_Shape(MouseType mouse, bool wsmall=false);
     55 		virtual void Revert_Mouse_Shape(void);
     56 		virtual MouseType Get_Mouse_Shape(void) const {return NormalMouseShape;};
     57 		virtual void Mouse_Small(bool wsmall);
     58 
     59 		/*
     60 		**	File I/O.
     61 		*/
     62 		virtual bool Load(Straw & file);
     63 		virtual bool Save(Pipe & file) const;
     64 
     65 		virtual void Set_Default_Mouse(MouseType mouse, bool wsmall = false);
     66 
     67 		/*
     68 		**	This allows the tactical map input gadget access to change the
     69 		**	mouse shapes.
     70 		*/
     71 		friend class TacticalClass;
     72 
     73 		/*
     74 		**	This points to the loaded mouse shapes.
     75 		*/
     76 		static void const * MouseShapes;
     77 
     78 	private:
     79 
     80 		/*
     81 		**	This type is used to control the frames and rates of the mouse
     82 		**	pointer. Some mouse pointers are actually looping animations.
     83 		*/
     84 		typedef struct MouseStruct
     85 		{
     86 			int StartFrame;			// Starting frame number.
     87 			int FrameCount;			// Number of animation frames.
     88 			int FrameRate;				// Frame delay between changing frames.
     89 			int SmallFrame;			// Start frame number for small version (if any).
     90 			int X,Y;						// Hotspot X and Y offset.
     91 		} MouseStruct;
     92 
     93 		/*
     94 		**	The control frames and rates for the various mouse pointers are stored
     95 		**	in this static array.
     96 		*/
     97 		static MouseStruct MouseControl[MOUSE_COUNT];
     98 
     99 	public:
    100 		/*
    101 		**	If the small representation of the mouse is active, then this flag is true.
    102 		*/
    103 		unsigned IsSmall:1;
    104 
    105 
    106 	private:
    107 		/*
    108 		**	The mouse shape is controlled by these variables. These
    109 		**	hold the current mouse shape (so resetting won't be needlessly performed) and
    110 		**	the normal default mouse shape (when arrow shapes are needed).
    111 		*/
    112 		MouseType CurrentMouseShape;
    113 		MouseType NormalMouseShape;
    114 
    115 		/*
    116 		**	For animating mouse shapes, this controls the frame and animation rate.
    117 		*/
    118 		static CDTimerClass<SystemTimerClass> Timer;
    119 		int Frame;
    120 };
    121 
    122 
    123 #endif