some deletion cleanup in main.cpp

This commit is contained in:
Stephen Birarda 2013-05-03 15:08:48 -07:00
parent 1a8564f9d9
commit da93b596de

View file

@ -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) { if (::chatEntryOn) {
chatEntry.specialKey(k); chatEntry.specialKey(k);
return; return;
@ -1534,7 +1533,6 @@ void keyUp(unsigned char k, int x, int y) {
if (k == 's') myAvatar.setDriveKeys(BACK, 0); if (k == 's') myAvatar.setDriveKeys(BACK, 0);
if (k == 'a') myAvatar.setDriveKeys(ROT_LEFT, 0); if (k == 'a') myAvatar.setDriveKeys(ROT_LEFT, 0);
if (k == 'd') myAvatar.setDriveKeys(ROT_RIGHT, 0); if (k == 'd') myAvatar.setDriveKeys(ROT_RIGHT, 0);
} }
void key(unsigned char k, int x, int y) 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! // Receive packets from other agents/servers and decide what to do with them!
void* networkReceive(void* args) void* networkReceive(void* args) {
{
sockaddr senderAddress; sockaddr senderAddress;
ssize_t bytesReceived; ssize_t bytesReceived;
@ -1699,9 +1696,7 @@ void idle(void) {
handControl.stop(); handControl.stop();
} }
//
// Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents // Sample hardware, update view frustum if needed, Lsend avatar data to mixer/agents
//
updateAvatar(deltaTime); updateAvatar(deltaTime);
// read incoming packets from network // 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; WIDTH = width;
HEIGHT = height; HEIGHT = height;
aspectRatio = ((float)width/(float)height); // based on screen resize aspectRatio = ((float)width/(float)height); // based on screen resize
@ -1760,17 +1753,12 @@ void reshape(int width, int height)
camera.setFieldOfView(fov = 60); 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 // Tell our viewFrustum about this change
::viewFrustum.setAspectRatio(aspectRatio); ::viewFrustum.setAspectRatio(aspectRatio);
glViewport(0, 0, width, height); // shouldn't this account for the menu??? glViewport(0, 0, width, height); // shouldn't this account for the menu???
glMatrixMode(GL_PROJECTION); //hello glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
// XXXBHG - If we're in view frustum mode, then we need to do this little bit of hackery so that // 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); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
} }
void mouseFunc( int button, int state, int x, int y ) void mouseFunc(int button, int state, int x, int y) {
{ if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN ) {
if( button == GLUT_LEFT_BUTTON && state == GLUT_DOWN ) if (state == GLUT_DOWN && !menu.mouseClick(x, y)) {
{
if (!menu.mouseClick(x, y)) {
mouseX = x; mouseX = x;
mouseY = y; mouseY = y;
mousePressed = 1; 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; mouseX = x;
mouseY = y; mouseY = y;
} }
void mouseoverFunc( int x, int y) void mouseoverFunc(int x, int y){
{
menu.mouseOver(x, y); menu.mouseOver(x, y);
mouseX = x; mouseX = x;
mouseY = y; mouseY = y;
if (mousePressed == 0)
{}
} }
void attachNewHeadToAgent(Agent *newAgent) { void attachNewHeadToAgent(Agent *newAgent) {