Merge branch 'master' of https://github.com/worklist/hifi
This commit is contained in:
Jeffrey Ventrella 2013-04-10 21:12:20 -07:00
commit 0564aa1a1b
4 changed files with 26 additions and 13 deletions

View file

@ -243,7 +243,7 @@ int audioCallback (const void *inputBuffer,
} else {
if (!ringBuffer->isStarted()) {
ringBuffer->setStarted(true);
printf("starting playback %3.1f msecs delayed \n", (usecTimestampNow() - usecTimestamp(&firstPlaybackTimer))/1000.0);
//printf("starting playback %3.1f msecs delayed \n", (usecTimestampNow() - usecTimestamp(&firstPlaybackTimer))/1000.0);
} else {
//printf("pushing buffer\n");
}

View file

@ -18,9 +18,14 @@
const int LINE_HEIGHT = 30;
const int MENU_HEIGHT = 30;
const int MENU_Y_OFFSET = 8; // under windows we have 8 vertical pixels offset. In 2D an object with y=8, the object is displayed at y=0
// change the value in the other platforms (if required).
#ifdef _WIN32
const int MENU_Y_OFFSET = 8; // under windows we have 8 vertical pixels offset.
// In 2D an object with y=8, the object is displayed at y=0
// change the value in the other platforms (if required).
#else
const int MENU_Y_OFFSET = 0;
#endif
Menu::Menu() {
currentColumn = -1;
@ -113,11 +118,14 @@ bool Menu::mouseOver(int x, int y) {
return overMenu;
}
const float MENU_COLOR[3] = {0.75, 0.75, 0.75};
void Menu::render(int screenWidth, int screenHeight) {
float scale = 0.10;
int mono = 0;
glColor3f(0.9, 0.9, 0.9);
glColor3fv(MENU_COLOR);
int width = screenWidth;
glEnable(GL_LINE_SMOOTH);
glBegin(GL_QUADS); {
glVertex2f(0, MENU_Y_OFFSET);
glVertex2f(width, MENU_Y_OFFSET);

View file

@ -128,7 +128,7 @@ void MenuColumn::render(int yOffset, int menuHeight, int lineHeight) {
}
glEnd();
}
float scale = 0.10;
float scale = 0.09;
int mono = 0;
int y = menuHeight + lineHeight / 2 ;
char* rowName;

View file

@ -179,7 +179,7 @@ int mouseStartX, mouseStartY; // Mouse location at start of last down click
int mousePressed = 0; // true if mouse has been pressed (clear when finished)
Menu menu; // main menu
int menuOn = 0; // Whether to show onscreen menu
int menuOn = 1; // Whether to show onscreen menu
//
// Serial USB Variables
@ -830,8 +830,8 @@ void display(void)
// Draw number of nearby people always
glPointSize(1.0f);
char agents[100];
sprintf(agents, "Agents nearby: %ld\n", agentList.getAgents().size());
drawtext(WIDTH-200,20, 0.10, 0, 1.0, 0, agents, 1, 1, 0);
sprintf(agents, "Agents: %ld\n", agentList.getAgents().size());
drawtext(WIDTH-100,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0);
if (::paintOn) {
@ -891,14 +891,20 @@ int setMirror(int state) {
}
void initMenu() {
MenuColumn *menuColumnOptions = menu.addColumn("Options");
MenuColumn *menuColumnOptions, *menuColumnTools, *menuColumnDebug;
// Options
menuColumnOptions = menu.addColumn("Options");
menuColumnOptions->addRow("Head", setHead);
menuColumnOptions->addRow("Field", setField);
menuColumnOptions->addRow("Noise", setNoise);
menuColumnOptions->addRow("Mirror", setMirror);
MenuColumn *menuColumnTools = menu.addColumn("Tools");
menuColumnOptions->addRow("Mirror", setMirror);
// Tools
menuColumnTools = menu.addColumn("Tools");
menuColumnTools->addRow("Stats", setStats);
menuColumnTools->addRow("Menu", setMenu);
menuColumnTools->addRow("Menu", setMenu);
// Debug
menuColumnDebug = menu.addColumn("Debug");
}
void testPointToVoxel()
@ -1082,7 +1088,6 @@ void key(unsigned char k, int x, int y)
#endif
}
// if (k == 'm') headMirror = !headMirror; // move in the menu
if (k == 'm') setMenu(-2);
if (k == 'f') displayField = !displayField;