MOUSE.H (4962B)
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: F:\projects\c&c\vcs\code\mouse.h_v 2.16 16 Oct 1995 16:45:06 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 46 /* 47 ** Initialization 48 */ 49 virtual void One_Time(void); // One-time inits 50 virtual void Init_Clear(void); // Clears all to known state 51 52 virtual void AI(KeyNumType &input, int x, int y); 53 virtual bool Override_Mouse_Shape(MouseType mouse, bool wwsmall=false); 54 virtual void Revert_Mouse_Shape(void); 55 virtual MouseType Get_Mouse_Shape(void) const {return NormalMouseShape;}; 56 virtual void Mouse_Small(bool wwsmall); 57 58 /* 59 ** File I/O. 60 */ 61 virtual bool Load(FileClass & file); 62 virtual bool Save(FileClass & file); 63 virtual void Code_Pointers(void); 64 virtual void Decode_Pointers(void); 65 66 virtual void Set_Default_Mouse(MouseType mouse, bool wwsmall = false); 67 68 /* 69 ** This allows the tactical map input gadget access to change the 70 ** mouse shapes. 71 */ 72 friend class TacticalClass; 73 74 private: 75 76 /* 77 ** This type is used to control the frames and rates of the mouse 78 ** pointer. Some mouse pointers are actually looping animations. 79 */ 80 typedef struct MouseStruct 81 { 82 int StartFrame; // Starting frame number. 83 int FrameCount; // Number of animation frames. 84 int FrameRate; // Frame delay between changing frames. 85 int SmallFrame; // Start frame number for small version (if any). 86 int X,Y; // Hotspot X and Y offset. 87 } MouseStruct; 88 89 /* 90 ** The control frames and rates for the various mouse pointers are stored 91 ** in this static array. 92 */ 93 static MouseStruct MouseControl[MOUSE_COUNT]; 94 95 /* 96 ** If the small representation of the mouse is active, then this flag is true. 97 */ 98 unsigned IsSmall:1; 99 100 /* 101 ** This points to the loaded mouse shapes. 102 */ 103 static void const * MouseShapes; 104 105 /* 106 ** The mouse shape is controlled by these variables. These 107 ** hold the current mouse shape (so resetting won't be needlessly performed) and 108 ** the normal default mouse shape (when arrow shapes are needed). 109 */ 110 MouseType CurrentMouseShape; 111 MouseType NormalMouseShape; 112 113 /* 114 ** For animating mouse shapes, this controls the frame and animation rate. 115 */ 116 static CountDownTimerClass Timer; 117 int Frame; 118 // StageClass Control; 119 120 /* 121 ** This contains the value of the Virtual Function Table Pointer 122 */ 123 static void * VTable; 124 }; 125 126 127 #endif