mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:36:56 +02:00
commit
0564aa1a1b
4 changed files with 26 additions and 13 deletions
|
@ -243,7 +243,7 @@ int audioCallback (const void *inputBuffer,
|
||||||
} else {
|
} else {
|
||||||
if (!ringBuffer->isStarted()) {
|
if (!ringBuffer->isStarted()) {
|
||||||
ringBuffer->setStarted(true);
|
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 {
|
} else {
|
||||||
//printf("pushing buffer\n");
|
//printf("pushing buffer\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,14 @@
|
||||||
|
|
||||||
const int LINE_HEIGHT = 30;
|
const int LINE_HEIGHT = 30;
|
||||||
const int MENU_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() {
|
Menu::Menu() {
|
||||||
currentColumn = -1;
|
currentColumn = -1;
|
||||||
|
@ -113,11 +118,14 @@ bool Menu::mouseOver(int x, int y) {
|
||||||
return overMenu;
|
return overMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const float MENU_COLOR[3] = {0.75, 0.75, 0.75};
|
||||||
|
|
||||||
void Menu::render(int screenWidth, int screenHeight) {
|
void Menu::render(int screenWidth, int screenHeight) {
|
||||||
float scale = 0.10;
|
float scale = 0.10;
|
||||||
int mono = 0;
|
int mono = 0;
|
||||||
glColor3f(0.9, 0.9, 0.9);
|
glColor3fv(MENU_COLOR);
|
||||||
int width = screenWidth;
|
int width = screenWidth;
|
||||||
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glBegin(GL_QUADS); {
|
glBegin(GL_QUADS); {
|
||||||
glVertex2f(0, MENU_Y_OFFSET);
|
glVertex2f(0, MENU_Y_OFFSET);
|
||||||
glVertex2f(width, MENU_Y_OFFSET);
|
glVertex2f(width, MENU_Y_OFFSET);
|
||||||
|
|
|
@ -128,7 +128,7 @@ void MenuColumn::render(int yOffset, int menuHeight, int lineHeight) {
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
float scale = 0.10;
|
float scale = 0.09;
|
||||||
int mono = 0;
|
int mono = 0;
|
||||||
int y = menuHeight + lineHeight / 2 ;
|
int y = menuHeight + lineHeight / 2 ;
|
||||||
char* rowName;
|
char* rowName;
|
||||||
|
|
|
@ -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)
|
int mousePressed = 0; // true if mouse has been pressed (clear when finished)
|
||||||
|
|
||||||
Menu menu; // main menu
|
Menu menu; // main menu
|
||||||
int menuOn = 0; // Whether to show onscreen menu
|
int menuOn = 1; // Whether to show onscreen menu
|
||||||
|
|
||||||
//
|
//
|
||||||
// Serial USB Variables
|
// Serial USB Variables
|
||||||
|
@ -830,8 +830,8 @@ void display(void)
|
||||||
// Draw number of nearby people always
|
// Draw number of nearby people always
|
||||||
glPointSize(1.0f);
|
glPointSize(1.0f);
|
||||||
char agents[100];
|
char agents[100];
|
||||||
sprintf(agents, "Agents nearby: %ld\n", agentList.getAgents().size());
|
sprintf(agents, "Agents: %ld\n", agentList.getAgents().size());
|
||||||
drawtext(WIDTH-200,20, 0.10, 0, 1.0, 0, agents, 1, 1, 0);
|
drawtext(WIDTH-100,20, 0.10, 0, 1.0, 0, agents, 1, 0, 0);
|
||||||
|
|
||||||
if (::paintOn) {
|
if (::paintOn) {
|
||||||
|
|
||||||
|
@ -891,14 +891,20 @@ int setMirror(int state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void initMenu() {
|
void initMenu() {
|
||||||
MenuColumn *menuColumnOptions = menu.addColumn("Options");
|
MenuColumn *menuColumnOptions, *menuColumnTools, *menuColumnDebug;
|
||||||
|
// Options
|
||||||
|
menuColumnOptions = menu.addColumn("Options");
|
||||||
menuColumnOptions->addRow("Head", setHead);
|
menuColumnOptions->addRow("Head", setHead);
|
||||||
menuColumnOptions->addRow("Field", setField);
|
menuColumnOptions->addRow("Field", setField);
|
||||||
menuColumnOptions->addRow("Noise", setNoise);
|
menuColumnOptions->addRow("Noise", setNoise);
|
||||||
menuColumnOptions->addRow("Mirror", setMirror);
|
menuColumnOptions->addRow("Mirror", setMirror);
|
||||||
MenuColumn *menuColumnTools = menu.addColumn("Tools");
|
// Tools
|
||||||
|
menuColumnTools = menu.addColumn("Tools");
|
||||||
menuColumnTools->addRow("Stats", setStats);
|
menuColumnTools->addRow("Stats", setStats);
|
||||||
menuColumnTools->addRow("Menu", setMenu);
|
menuColumnTools->addRow("Menu", setMenu);
|
||||||
|
// Debug
|
||||||
|
menuColumnDebug = menu.addColumn("Debug");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void testPointToVoxel()
|
void testPointToVoxel()
|
||||||
|
@ -1082,7 +1088,6 @@ void key(unsigned char k, int x, int y)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (k == 'm') headMirror = !headMirror; // move in the menu
|
|
||||||
if (k == 'm') setMenu(-2);
|
if (k == 'm') setMenu(-2);
|
||||||
|
|
||||||
if (k == 'f') displayField = !displayField;
|
if (k == 'f') displayField = !displayField;
|
||||||
|
|
Loading…
Reference in a new issue