SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送

DxExInputTools.hpp

解説を見る。
00001 
00002 
00003 #   pragma warning(disable:4800)
00004 
00005 #ifndef _pc_InputTools__
00006 #define _pc_InputTools__
00007 
00008 
00009 //#include "pcDefined.h"
00010 //#include "pcTools.h"
00011 #include "DxLibEx.hpp"
00012 //#include "pcGlobalObj.h"
00013 
00014 
00015 
00034 class DxExInputTools : public IdKingyoInputManager {
00035 
00036     DKINGYO_INPUT_DATA m_i;
00037     int m_former;
00038 public:
00039     //DKINGYO_INPUT_DATA &GetInputDataRef(){return m_i;}
00040     DxExInputTools(){
00041         ::memset(&m_i,0,sizeof(m_i));
00042         m_former = 0;
00043     };
00044     virtual ~DxExInputTools(){}
00046     virtual int GetInputAll();
00047 
00048     virtual int GetJoypadNum();
00049     virtual int GetJoypadState(int ID) ;
00050     virtual int GetJoypadAnalogInput( int *XBuf , int *YBuf , int InputType);
00051     
00052     virtual int SetMouseDispFlag( bool DispFlag ) ;
00053     virtual int GetMousePoint( int *XBuf, int *YBuf ) ;
00054     virtual int SetMousePoint( int PointX , int PointY ) ;
00055     virtual int GetMouseInput( ) ;
00056     virtual int GetMouseWheelRotVol( ) ;
00057 
00058     virtual int CheckHitKeyAll(  ) ;
00059     virtual int CheckHitKey( int KeyCode );
00060     virtual int GetHitKeyStateAll( char *KeyStateBuf );
00061     
00062 
00063 
00064 
00065     #define G_INPUT(s) ((m_i.JoyPadAndKeybord) & s)
00066 
00067     bool isDownKey(){   return (G_INPUT(PAD_INPUT_DOWN));}
00068     bool isLeftKey(){   return G_INPUT(PAD_INPUT_LEFT);}
00069     bool isRightKey(){ return G_INPUT(PAD_INPUT_RIGHT);}
00070     bool isUpKey(){return G_INPUT(PAD_INPUT_UP);}
00071 
00072 
00073 protected:
00074         inline bool isAKey(){return G_INPUT(PAD_INPUT_A);}
00075         inline bool isBKey(){return G_INPUT(PAD_INPUT_B);}
00076         inline bool isCKey(){return G_INPUT(PAD_INPUT_C);}
00077         inline bool isXKey(){return G_INPUT(PAD_INPUT_X);}
00078         inline bool isYKey(){return G_INPUT(PAD_INPUT_Y);}
00079         inline bool isZKey(){return G_INPUT(PAD_INPUT_Z);}
00080         inline bool isLKey(){return G_INPUT(PAD_INPUT_L);}
00081         inline bool isRKey(){return G_INPUT(PAD_INPUT_R);}
00082         inline bool isStartKey(){return G_INPUT(PAD_INPUT_START);}
00083         inline bool isMKey(){return G_INPUT(PAD_INPUT_M);}
00084         
00085 public:
00086 #   define ONCE_(is_,input_type) \
00087         bool f=false;\
00088         if( is_ ){ \
00089             if(m_former & input_type){ \
00090                 f=false; \
00091             }else{ \
00092                 f=true; \
00093             } \
00094         } \
00095         return f
00096     
00097     inline bool isZOnce(){  ONCE_(isAKey(),PAD_INPUT_A);}
00098     inline bool isXOnce(){  ONCE_(isBKey(),PAD_INPUT_B);}
00099     inline bool isDownOnce(){ ONCE_(isDownKey(),PAD_INPUT_DOWN); }
00100     inline bool isLeftOnce(){ ONCE_(isLeftKey(),PAD_INPUT_LEFT); }
00101     inline bool isRightOnce(){ ONCE_(isRightKey(),PAD_INPUT_RIGHT); }
00102     inline bool isUpOnce(){ ONCE_(isUpKey(),PAD_INPUT_UP); }
00103 
00104 #   undef ONCE_
00105 
00106 
00107     inline bool isZ(){return isAKey();}
00108     inline bool isX(){return isBKey();}
00109     inline bool isC(){return isCKey();}
00110     inline bool isA(){return isXKey();}
00111     inline bool isS(){return isYKey();}
00112     inline bool isD(){return isZKey();}
00113     inline bool isQ(){return isLKey();}
00114     inline bool isW(){return isRKey();}
00115     inline bool isSpace(){return isMKey();}
00116     inline bool isESC(){return isStartKey();}
00117 
00118     
00119     #undef G_INPUT
00120 };
00121 
00122 
00123 
00124 #endif //end of include once
00125 
00126 #   pragma warning(default : 4800 )

DxLib Extension Library ( DxEx )に対してThu Aug 21 13:18:57 2003に生成されました。 doxygen1.3