summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--facetracknoir/curve-config.cpp6
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.cpp2
-rw-r--r--ftnoir_filter_accela/ftnoir_filter_accela.h2
-rw-r--r--ftnoir_posewidget/glwidget.cpp40
-rw-r--r--ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp2
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.cpp10
-rw-r--r--qfunctionconfigurator/qfunctionconfigurator.h5
7 files changed, 19 insertions, 48 deletions
diff --git a/facetracknoir/curve-config.cpp b/facetracknoir/curve-config.cpp
index 1e911ddd..2bff009a 100644
--- a/facetracknoir/curve-config.cpp
+++ b/facetracknoir/curve-config.cpp
@@ -83,10 +83,8 @@ void CurveConfigurationDialog::loadSettings() {
for (int i = 0; i < 6; i++)
{
- configs[i]->setConfig(&mainApp->axis(i).curve, currentFile);
- alt_configs[i]->setConfig(&mainApp->axis(i).curveAlt, currentFile);
- configs[i]->loadSettings(currentFile);
- alt_configs[i]->loadSettings(currentFile);
+ configs[i]->setConfig(&mainApp->axis(i).curve);
+ alt_configs[i]->setConfig(&mainApp->axis(i).curveAlt);
}
}
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.cpp b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
index 558b3189..13e4ea79 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.cpp
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.cpp
@@ -78,8 +78,6 @@ void FTNoIR_Filter::FilterHeadPoseData(const double* target_camera_position,
return;
}
- QMutexLocker foo(&mutex);
-
for (int i=0;i<6;i++)
{
const double vec = target_camera_position[i] - last_output[0][i];
diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h
index 42d9b772..42db2e47 100644
--- a/ftnoir_filter_accela/ftnoir_filter_accela.h
+++ b/ftnoir_filter_accela/ftnoir_filter_accela.h
@@ -48,7 +48,6 @@ public:
private:
settings s;
- QMutex mutex;
bool first_run;
double last_input[6];
double last_output[3][6];
@@ -66,7 +65,6 @@ class FilterControls: public QWidget, public IFilterDialog
Q_OBJECT
public:
FilterControls();
- void reset(QWidget *);
void registerFilter(IFilter* filter);
void unregisterFilter();
private:
diff --git a/ftnoir_posewidget/glwidget.cpp b/ftnoir_posewidget/glwidget.cpp
index ab8bede1..26803385 100644
--- a/ftnoir_posewidget/glwidget.cpp
+++ b/ftnoir_posewidget/glwidget.cpp
@@ -175,35 +175,19 @@ void GLWidget::project_quad_texture() {
Vec2f coords;
if (triangles[i].barycentric_coords(pos, coords))
{
- double qx = origs[i][0].x
- + coords.x * (origs[i][2].x - origs[i][0].x)
- + coords.y * (origs[i][1].x - origs[i][0].x);
- double qy = origs[i][0].y
- + coords.x * (origs[i][2].y - origs[i][0].y)
- + coords.y * (origs[i][1].y - origs[i][0].y);
- int qx1 = std::min<int>(ow - 1, std::max<int>(0, qx));
- int qy1 = std::min<int>(oh - 1, std::max<int>(0, qy));
- int qx2 = std::min<int>(ow - 1, std::max<int>(0, qx + 1.0));
- int qy2 = std::min<int>(oh - 1, std::max<int>(0, qy + 1.0));
+ int px = origs[i][0].x
+ + coords.x * (origs[i][2].x - origs[i][0].x)
+ + coords.y * (origs[i][1].x - origs[i][0].x);
+ int py = origs[i][0].y
+ + coords.x * (origs[i][2].y - origs[i][0].y)
+ + coords.y * (origs[i][1].y - origs[i][0].y);
+ int r = orig[py * orig_pitch + px * orig_depth + 2];
+ int g = orig[py * orig_pitch + px * orig_depth + 1];
+ int b = orig[py * orig_pitch + px * orig_depth + 0];
- int r = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 2]
- + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 2]
- + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 2]
- + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 2]) / 9;
-
- int g = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 1]
- + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 1]
- + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 1]
- + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 1]) / 9;
-
- int b = (4 * orig[qy1 * orig_pitch + qx1 * orig_depth + 0]
- + 1 * orig[qy2 * orig_pitch + qx2 * orig_depth + 0]
- + 2 * orig[qy1 * orig_pitch + qx2 * orig_depth + 0]
- + 2 * orig[qy2 * orig_pitch + qx1 * orig_depth + 0]) / 9;
-
- dest[y * dest_pitch + x * dest_depth + 0] = std::max<int>(0, std::min<int>(255, r));
- dest[y * dest_pitch + x * dest_depth + 1] = std::max<int>(0, std::min<int>(255, g));
- dest[y * dest_pitch + x * dest_depth + 2] = std::max<int>(0, std::min<int>(255, b));
+ dest[y * dest_pitch + x * dest_depth + 0] = r;
+ dest[y * dest_pitch + x * dest_depth + 1] = g;
+ dest[y * dest_pitch + x * dest_depth + 2] = b;
break;
}
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
index 76767c3b..a3a5cb5f 100644
--- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
+++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp
@@ -16,6 +16,8 @@ FTNoIR_Protocol::~FTNoIR_Protocol()
void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) {
JOYSTICK_STATE state[2] = { 0 };
+
+ state[0].POV = (4 << 12) | (4 << 8) | (4 << 4) | 4;
state[0].XAxis = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[Yaw] * VJOY_AXIS_MAX / 180.0));
state[0].YAxis = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[Pitch] * VJOY_AXIS_MAX / 180.0));
diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp
index b959b56c..55d1e1bc 100644
--- a/qfunctionconfigurator/qfunctionconfigurator.cpp
+++ b/qfunctionconfigurator/qfunctionconfigurator.cpp
@@ -36,7 +36,7 @@ QFunctionConfigurator::QFunctionConfigurator(QWidget *parent)
setMouseTracking(true);
}
-void QFunctionConfigurator::setConfig(FunctionConfig* config, QString settingsFile) {
+void QFunctionConfigurator::setConfig(FunctionConfig* config) {
QSettings settings("opentrack"); // Registry settings (in HK_USER)
QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString();
QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
@@ -48,14 +48,6 @@ void QFunctionConfigurator::setConfig(FunctionConfig* config, QString settingsFi
update();
}
-void QFunctionConfigurator::loadSettings(QString settingsFile) {
-
- QSettings iniFile( settingsFile, QSettings::IniFormat ); // Application settings (in INI-file)
- if (_config) {
- _config->loadSettings(iniFile);
- }
-}
-
void QFunctionConfigurator::saveSettings(QString settingsFile) {
QSettings iniFile( settingsFile, QSettings::IniFormat ); // Application settings (in INI-file)
diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h
index bb2aced0..1f6b4f78 100644
--- a/qfunctionconfigurator/qfunctionconfigurator.h
+++ b/qfunctionconfigurator/qfunctionconfigurator.h
@@ -34,9 +34,8 @@ public:
QFunctionConfigurator(QWidget *parent = 0);
FunctionConfig* config();
- void setConfig(FunctionConfig* config, QString settingsFile); // Connect the FunctionConfig to the Widget.
- void loadSettings(QString settingsFile); // Load the FunctionConfig (points) from the INI-file
- void saveSettings(QString settingsFile); // Save the FunctionConfig (points) to the INI-file
+ void setConfig(FunctionConfig* config);
+ void saveSettings(QString settingsFile);
signals:
void CurveChanged(bool);