diff options
author | Wei Shuai <cpuwolf@gmail.com> | 2018-01-20 21:28:29 +0800 |
---|---|---|
committer | Wei Shuai <cpuwolf@gmail.com> | 2018-01-21 20:52:44 +0800 |
commit | 78cea261bb42434c73e27ef0081683219f141895 (patch) | |
tree | e8f1f1a77527f9463a94310629ffa2886b44d900 /tracker-pt/tracker-wii/wii_camera.h | |
parent | e676b6360e319431cf13d974126e23ecd5fb38c0 (diff) |
tracker/wii: update according to Issue: #718 suggestion from sthalik
1. fix horizon line drawing
2. fix copyright
3. optimize pointer mangement
4. reduce wii led power consumption
Diffstat (limited to 'tracker-pt/tracker-wii/wii_camera.h')
-rw-r--r-- | tracker-pt/tracker-wii/wii_camera.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tracker-pt/tracker-wii/wii_camera.h b/tracker-pt/tracker-wii/wii_camera.h index a7ac9c14..6518de91 100644 --- a/tracker-pt/tracker-wii/wii_camera.h +++ b/tracker-pt/tracker-wii/wii_camera.h @@ -1,5 +1,4 @@ -/* Copyright (c) 2012 Patrick Ruoff - * Copyright (c) 2015-2016 Stanislaw Halik <sthalik@misaki.pl> +/* * Copyright (c) 2017-2018 Wei Shuai <cpuwolf@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any @@ -26,7 +25,13 @@ #include "wii_frame.hpp" namespace pt_module { - +#if 0 +struct WIICameraInfo final : pt_camera_info +{ + WIICameraInfo() {} + double get_focal_length() const { return 42.; } +}; +#endif struct WIICamera final : pt_camera { WIICamera(const QString& module_name); @@ -41,14 +46,14 @@ struct WIICamera final : pt_camera QString get_desired_name() const override; QString get_active_name() const override; - operator bool() const override { return (m_pDev); } + operator bool() const override { return m_pDev && (!m_pDev->ConnectionLost()); } void set_fov(double value) override { fov = value; } void show_camera_settings() override; private: - wiimote * m_pDev; + std::unique_ptr<wiimote> m_pDev; static void on_state_change(wiimote &remote, state_change_flags changed, const wiimote_state &new_state); |