removed _mouse{X,Y}

This commit is contained in:
Atlante45 2014-12-05 17:02:49 -08:00
parent 469c958c98
commit ee124f580d
2 changed files with 3 additions and 20 deletions

View file

@ -165,8 +165,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_scaleMirror(1.0f),
_rotateMirror(0.0f),
_raiseMirror(0.0f),
_mouseX(0),
_mouseY(0),
_lastMouseMove(usecTimestampNow()),
_lastMouseMoveWasSimulated(false),
_mouseHidden(false),
@ -1282,9 +1280,6 @@ void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) {
_mouseHidden = false;
_seenMouseMove = true;
}
_mouseX = event->x();
_mouseY = event->y();
}
void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) {
@ -1302,8 +1297,6 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) {
if (activeWindow() == _window) {
if (event->button() == Qt::LeftButton) {
_mouseX = event->x();
_mouseY = event->y();
_mouseDragStartedX = getTrueMouseX();
_mouseDragStartedY = getTrueMouseY();
_mousePressed = true;
@ -1346,8 +1339,6 @@ void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) {
if (activeWindow() == _window) {
if (event->button() == Qt::LeftButton) {
_mouseX = event->x();
_mouseY = event->y();
_mousePressed = false;
if (Menu::getInstance()->isOptionChecked(MenuOption::Stats) && mouseOnScreen()) {
@ -1940,9 +1931,6 @@ void Application::init() {
_voxelShader.init();
_pointShader.init();
_mouseX = _glWidget->width() / 2;
_mouseY = _glWidget->height() / 2;
// TODO: move _myAvatar out of Application. Move relevant code to MyAvataar or AvatarManager
_avatarManager.init();
_myCamera.setMode(CAMERA_MODE_FIRST_PERSON);
@ -3557,9 +3545,6 @@ void Application::deleteVoxelAt(const VoxelDetail& voxel) {
}
void Application::resetSensors() {
_mouseX = _glWidget->width() / 2;
_mouseY = _glWidget->height() / 2;
_faceshift.reset();
_visage.reset();
_dde.reset();
@ -3572,7 +3557,7 @@ void Application::resetSensors() {
QScreen* currentScreen = _window->windowHandle()->screen();
QWindow* mainWindow = _window->windowHandle();
QPoint windowCenter = mainWindow->geometry().center();
QCursor::setPos(currentScreen, windowCenter);
_glWidget->cursor().setPos(currentScreen, windowCenter);
_myAvatar->reset();

View file

@ -217,8 +217,8 @@ public:
bool mouseOnScreen() const;
int getMouseX() const;
int getMouseY() const;
int getTrueMouseX() const { return _mouseX; }
int getTrueMouseY() const { return _mouseY; }
int getTrueMouseX() const { return _glWidget->mapFromGlobal(QCursor::pos()).x(); }
int getTrueMouseY() const { return _glWidget->mapFromGlobal(QCursor::pos()).y(); }
int getMouseDragStartedX() const;
int getMouseDragStartedY() const;
int getTrueMouseDragStartedX() const { return _mouseDragStartedX; }
@ -563,8 +563,6 @@ private:
Environment _environment;
int _mouseX;
int _mouseY;
int _mouseDragStartedX;
int _mouseDragStartedY;
quint64 _lastMouseMove;