ctr_Repair/trunk/SkipFirstLaunch/sysInput.h
N2614 a6203551a6 ビルドが通るように
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@652 385bec56-5757-e545-9c3a-d8741f4650f1
2012-02-22 04:22:39 +00:00

162 lines
5.0 KiB
C++

/*!
@file sysInput.h
@brief 入力
*/
#ifndef SYS_INPUT_H_
#define SYS_INPUT_H_
#include <nw.h>
#ifdef NW_PLATFORM_CTR
#include <nn/hid.h>
#include <nn/hid/CTR/hid_PadReaderWithSvr2.h>
#else
#include <windows.h>
#endif
//#include "guiManager.h"
//#include "guiButton.h"
//#include "guiRadioButton.h"
//#include "guiRepeatButton.h"
//#include "guiSliderBar.h"
//#include "guiMayaButton.h"
//#include "guiTouchSlider.h"
//#include "utUtil.h"
//#include "sysDialogManager.h"
//#include "sceneCalibrationLayout.h"
//#include "sceneCalibrationGuiOperator.h"
//#include "sceneStartLayout.h"
//#include "sceneCoppaLayout.h"
#ifndef NW_RELEASE
//#include "sceneSceneController.h"
//#include "sceneDebugLayout.h"
//#include "sceneDialogScene.h"
//#include "sceneDataMngLayout.h"
//#include "sceneDataCmmLayout.h"
#ifdef NW_PLATFORM_CTR
//#include "sceneInternetThread.h"
//#include "sceneDataMngThread.h"
//#include "sceneCoppaThread.h"
//#include "sceneCheckScene.h"
#endif
#endif
namespace sys
{
class Input
{
public:
#ifdef NW_PLATFORM_CTRWIN
static const int BUTTON_A = nn::hw::pad::BUTTON_A;
static const int BUTTON_B = nn::hw::pad::BUTTON_B;
static const int BUTTON_SELECT = nn::hw::pad::BUTTON_SELECT;
static const int BUTTON_START = nn::hw::pad::BUTTON_START;
static const int KEY_RIGHT = nn::hw::pad::KEY_RIGHT;
static const int KEY_LEFT = nn::hw::pad::KEY_LEFT;
static const int KEY_UP = nn::hw::pad::KEY_UP;
static const int KEY_DOWN = nn::hw::pad::KEY_DOWN;
static const int BUTTON_R = nn::hw::pad::BUTTON_R;
static const int BUTTON_L = nn::hw::pad::BUTTON_L;
static const int BUTTON_X = nn::hw::pad::BUTTON_X;
static const int BUTTON_Y = nn::hw::pad::BUTTON_Y;
static const int BUTTON_DEBUG = nn::hw::pad::BUTTON_DEBUG;
#endif
#ifdef NW_PLATFORM_CTR
static const int BUTTON_A = nn::hid::CTR::BUTTON_A;
static const int BUTTON_B = nn::hid::CTR::BUTTON_B;
static const int BUTTON_SELECT = nn::hid::CTR::PSEUDO_BUTTON_SELECT;
static const int BUTTON_START = nn::hid::CTR::BUTTON_START;
static const int KEY_RIGHT = nn::hid::CTR::BUTTON_RIGHT;
static const int KEY_LEFT = nn::hid::CTR::BUTTON_LEFT;
static const int KEY_UP = nn::hid::CTR::BUTTON_UP;
static const int KEY_DOWN = nn::hid::CTR::BUTTON_DOWN;
static const int BUTTON_R = nn::hid::CTR::BUTTON_R;
static const int BUTTON_L = nn::hid::CTR::BUTTON_L;
static const int BUTTON_X = nn::hid::CTR::BUTTON_X;
static const int BUTTON_Y = nn::hid::CTR::BUTTON_Y;
static const int BUTTON_DEBUG = nn::hid::CTR::BUTTON_DEBUG;
#endif
static void init();
static void update( int system_stt );
static void finish();
static f32 getSvr2Volume();
static f32 getNormalizeX();
static f32 getNormalizeY();
static const f32 c3dVolume = 0.85f;
private:
static u16 isTouched();
static u16 isReleased();
static u16 isTouching();
static const nw::math::VEC2& getPos(){ return msTPPos; }
static u16 getPadTrig();
static bool isButtonTrig( u16 button );
static bool isButtonHold( u16 button );
static u16 msPad;
static u16 msPadPrev;
static u16 msPadTrig;
static bool msTP; // タッチしているときtrue.
static bool msTPTouch; // 1フレーム前にタッチしていたときtrue.
static nw::math::VEC2 msTPPos; // タッチしているときのタッチ位置の整数値.
static nw::math::VEC2 msTPFloatPos; // タッチしているときのタッチ位置.
#ifdef NW_PLATFORM_CTR
static nn::hid::CTR::PadReader* mspPadReader;
static nn::hid::CTR::PadStatus* mspPadStatus;
static nn::hid::CTR::TouchPanelReader* mspTpReader;
static nn::hid::CTR::TouchPanelStatus* mspTpStatus;
static nn::hid::CTR::PadReaderWithSvr2* smpPadReaderWithSvr2;
#else
static LRESULT Callback( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL *handled );
#endif
//friend class gui::Manager;
//friend class gui::Button;
//friend class gui::RepeatButton;
//friend class gui::RadioButton;
//friend class gui::SliderBar;
//friend class gui::MayaButton;
//friend class gui::TouchSlider;
//friend class DialogManager;
//friend class DialogButton;
//friend int ut::IsInBoundPane( lyt::Object* lyt_obj, const char* group_name );
//friend class scene::CalibrationLayout;
//friend class scene::CalibrationGuiOperator;
//friend class scene::StartLayout;
//friend class scene::CoppaLayout;
#ifndef NW_RELEASE
//friend class scene::SceneController;
//friend class scene::DebugLayout;
//friend class scene::DialogScene;
//friend class scene::DataMngLayout;
//friend class scene::DataCmmLayout;
//friend class scene::CheckScene;
//friend class scene::InternetFnc;
//friend class scene::DataMngFnc;
//friend class scene::CoppaFnc;
#endif
};
}
#endif