diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 125cc07597..990f4e8197 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -1491,8 +1491,7 @@ void specialkeyUp(int k, int x, int y) { } -void specialkey(int k, int x, int y) -{ +void specialkey(int k, int x, int y) { if (::chatEntryOn) { chatEntry.specialKey(k); return; @@ -1534,7 +1533,6 @@ void keyUp(unsigned char k, int x, int y) { if (k == 's') myAvatar.setDriveKeys(BACK, 0); if (k == 'a') myAvatar.setDriveKeys(ROT_LEFT, 0); if (k == 'd') myAvatar.setDriveKeys(ROT_RIGHT, 0); - } void key(unsigned char k, int x, int y) @@ -1626,8 +1624,7 @@ void key(unsigned char k, int x, int y) } // Receive packets from other agents/servers and decide what to do with them! -void* networkReceive(void* args) -{ +void* networkReceive(void* args) { sockaddr senderAddress; ssize_t bytesReceived; @@ -1699,9 +1696,7 @@ void idle(void) { handControl.stop(); } - // // Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents - // updateAvatar(deltaTime); // read incoming packets from network @@ -1732,9 +1727,7 @@ void idle(void) { } } - -void reshape(int width, int height) -{ +void reshape(int width, int height) { WIDTH = width; HEIGHT = height; aspectRatio = ((float)width/(float)height); // based on screen resize @@ -1760,17 +1753,12 @@ void reshape(int width, int height) camera.setFieldOfView(fov = 60); } - //printLog("reshape() width=%d, height=%d, aspectRatio=%f fov=%f near=%f far=%f \n", - // width,height,aspectRatio,fov,nearClip,farClip); - // Tell our viewFrustum about this change ::viewFrustum.setAspectRatio(aspectRatio); - glViewport(0, 0, width, height); // shouldn't this account for the menu??? - glMatrixMode(GL_PROJECTION); //hello - + glMatrixMode(GL_PROJECTION); glLoadIdentity(); // XXXBHG - If we're in view frustum mode, then we need to do this little bit of hackery so that @@ -1787,42 +1775,32 @@ void reshape(int width, int height) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - - } -void mouseFunc( int button, int state, int x, int y ) -{ - if( button == GLUT_LEFT_BUTTON && state == GLUT_DOWN ) - { - if (!menu.mouseClick(x, y)) { +void mouseFunc(int button, int state, int x, int y) { + if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN ) { + if (state == GLUT_DOWN && !menu.mouseClick(x, y)) { mouseX = x; mouseY = y; mousePressed = 1; + } else if (state == GLUT_UP) { + mouseX = x; + mouseY = y; + mousePressed = 0; } - } - if( button == GLUT_LEFT_BUTTON && state == GLUT_UP ) { - mouseX = x; - mouseY = y; - mousePressed = 0; - } - + } } -void motionFunc( int x, int y) -{ +void motionFunc(int x, int y) { mouseX = x; mouseY = y; } -void mouseoverFunc( int x, int y) -{ +void mouseoverFunc(int x, int y){ menu.mouseOver(x, y); mouseX = x; mouseY = y; - if (mousePressed == 0) - {} } void attachNewHeadToAgent(Agent *newAgent) {