From 620e1c728c6dbb37f9389e6873ba6a2c62d3bcaf Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 25 Apr 2013 15:41:09 -0700 Subject: [PATCH] Removed kludge; it turned out lighting was enabled. --- interface/src/Avatar.cpp | 15 ++++++--------- interface/src/ChatEntry.h | 1 - interface/src/main.cpp | 7 ++++++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index 965de70822..b6be2e072d 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -37,6 +37,8 @@ bool usingBigSphereCollisionTest = true; char iris_texture_file[] = "resources/images/green_eye.png"; +float chatMessageScale = 0.00025; + vector iris_texture; unsigned int iris_texture_width = 512; unsigned int iris_texture_height = 256; @@ -657,7 +659,7 @@ void Avatar::render(bool lookingInMirror) { if (!_chatMessage.empty()) { float width = 0; for (string::iterator it = _chatMessage.begin(); it != _chatMessage.end(); it++) { - width += glutStrokeWidth(GLUT_STROKE_ROMAN, *it)*0.00025; + width += glutStrokeWidth(GLUT_STROKE_ROMAN, *it)*chatMessageScale; } glPushMatrix(); @@ -671,14 +673,9 @@ void Avatar::render(bool lookingInMirror) { glRotatef(atan2(-modelview[2], -modelview[10]) * 180 / PI, 0, 1, 0); glTranslatef(width * 0.5, 0, 0); - // TODO: For no apparent reason, OpenGL is hiding the first character. This fixes it (it - // gets hidden instead), but we should find and fix the underlying problem. - glBegin(GL_LINE_STRIP); - glVertex2f(0, 0); - glVertex2f(0, 0); - glEnd(); - - drawtext(0, 0, 0.00025, 180, 1.0, 0, _chatMessage.c_str(), 0, 1, 0); + glDisable(GL_LIGHTING); + drawtext(0, 0, chatMessageScale, 180, 1.0, 0, _chatMessage.c_str(), 0, 1, 0); + glEnable(GL_LIGHTING); glPopMatrix(); } diff --git a/interface/src/ChatEntry.h b/interface/src/ChatEntry.h index b71a3d1b96..ea9fc8eb77 100644 --- a/interface/src/ChatEntry.h +++ b/interface/src/ChatEntry.h @@ -19,7 +19,6 @@ public: void clear (); bool key(unsigned char k); - void specialKey(unsigned char k); void render(int screenWidth, int screenHeight); diff --git a/interface/src/main.cpp b/interface/src/main.cpp index 1d7d8b1481..dc716cfe41 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -1455,7 +1455,12 @@ void key(unsigned char k, int x, int y) if (k == 'g') renderPitchRate += KEYBOARD_PITCH_RATE; if (k == 'a') myAvatar.setDriveKeys(ROT_LEFT, 1); if (k == 'd') myAvatar.setDriveKeys(ROT_RIGHT, 1); - if (k == '\r') ::chatEntryOn = true; + + if (k == '\r') { + ::chatEntryOn = true; + myAvatar.setKeyState(AvatarData::NoKeyDown); + myAvatar.setChatMessage(string()); + } } // Receive packets from other agents/servers and decide what to do with them!