void WypWindow::onSpecial(int key, int x, int y) { switch (key) { /* case GLUT_KEY_DOWN : world.rotateX -= setting.angleInc; break; case GLUT_KEY_UP : world.rotateX += setting.angleInc; break; case GLUT_KEY_LEFT : world.rotateY -= setting.angleInc; break; case GLUT_KEY_RIGHT : world.rotateY += setting.angleInc; break; */ case GLUT_KEY_HOME : dataInit(); break; case GLUT_KEY_F1 : setting.shadingMode = !setting.shadingMode; if (setting.shadingMode) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); else glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); break; case GLUT_KEY_F2 : worldaxis.toggle(); break; case GLUT_KEY_F3 : GLboolean lightingIsOn; glGetBooleanv(GL_LIGHTING, &lightingIsOn); if (lightingIsOn==GL_TRUE) glDisable(GL_LIGHTING); else glEnable(GL_LIGHTING); break; } onSpecialSignal.broadcast(key); }
void MainWindow::restartGame() { if(gamepause == false) { deleteAll(); gameInit(); dataInit(); setBtn(); } }
WypWindow::WypWindow(std::string title) : GlutWindow(title), virtualworld(nullptr) { dataInit(); viewingInit(); lightingInit(); selMaster = new SelectMaster(viewer, world); welcome(); }
static int __init moduleInit(void) { if(deviceCreate()!=0) return -1; dataInit(); usb_for_each_dev(NULL, find_linak); if(DATA.udev == NULL) { printk(KERN_ERR "no device found"); return -1; } updateStatus_force(); return 0; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); // Enable the event Filter qApp->installEventFilter(this); // background music bgm = new QMediaPlayer(); bgm->setMedia(QUrl("qrc:/image/bgm.mp3")); //set scoreboard scoredisplay = new QLabel(this); scoredisplay->setStyleSheet("color:black; background-color: transparent; font: 32pt Comic Sans MS"); scoredisplay->setText("Score :"); scoredisplay->setGeometry(900, 10, 150, 50); scoredisplay->show(); scoreboard = new QLabel(this); scoreboard->setStyleSheet("color:black; background-color: transparent; font: 32pt Comic Sans MS"); scoreboard->setGeometry(1055, 10, 100, 50); scoreboard->show(); //set number of birds numdisplay = new QLabel(this); numdisplay->setPixmap(QPixmap(":/image/numdisplay.png").scaled(80,51)); numdisplay->setGeometry(700, 10, 80, 51); numdisplay->show(); birdnum = new QLabel(this); birdnum->setStyleSheet("color:black; background-color: transparent; font: 32pt Comic Sans MS"); birdnum->setGeometry(790, 12, 50, 50); birdnum->show(); gameInit(); dataInit(); setBtn(); // Timer connect(&timer,SIGNAL(timeout()),this,SLOT(tick())); connect(this,SIGNAL(quitGame()),this,SLOT(QUITSLOT())); timer.start(100/6); }
int main(int argc, char *argv[]) { int i; signal(SIGINT, SIG_IGN); setbuf(stdin, NULL); // windows only: SYSTEM_INFO sysinfo; std::cout << KENNY_PROG_VERSION << std::endl; #ifdef KENNY_DEBUG_PERFT std::cout << "KENNY_DEBUG_PERFT defined" << std::endl; #endif #ifdef KENNY_DEBUG_MOVES std::cout << "KENNY_DEBUG_MOVES defined" << std::endl; #endif #ifdef KENNY_VERBOSE_EVAL std::cout << "KENNY_VERBOSE_EVAL defined" << std::endl; #endif #ifdef KENNY_DEBUG_EVAL std::cout << "KENNY_DEBUG_EVAL defined" << std::endl; #endif #ifdef KENNY_VERBOSE_SEE std::cout << "KENNY_VERBOSE_SEE defined" << std::endl; #endif #ifdef KENNY_DEBUG_WINBOARD std::cout << "KENNY_DEBUG_WINBOARD defined" << std::endl; #endif #ifdef KENNY_CUSTOM_VALUES std::cout << "KENNY_CUSTOM_VALUES defined" << std::endl; #endif #ifdef KENNY_CUSTOM_POSVALS std::cout << "KENNY_CUSTOM_VALUES defined" << std::endl; #endif #ifdef KENNY_CUSTOM_PSTABLES std::cout << "KENNY_CUSTOM_PSTABLES defined" << std::endl; #endif #ifdef KENNY_CUSTOM_ENDGAME std::cout << "KENNY_CUSTOM_ENDGAME defined" << std::endl; #endif dataInit(); board.init(); // windows only: GetSystemInfo(&sysinfo); if (sysinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) std::cout << "Version: X86, "; else if (sysinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64) std::cout << "Version: IA64, "; else if (sysinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) std::cout << "Version: X64, "; std::cout << sysinfo.dwNumberOfProcessors << " CPU's (1 CPU used)" << std::endl; std::cout << "Search structure = " << sizeof(board)/1024 << "kB" << std::endl; // read the initialization file: strcpy(PATHNAME, argv[0]); strcpy(INIFILE, "KENNYx.ini"); // default name // check command-line to see if we need to use another ini-file: // usage: "KENNYx.exe i=somefile.ini" for (i = 1; i < argc; i++) { if (!strncmp(argv[i], "i=", 2)) sscanf_s(argv[i]+2,"%s", INIFILE); } readIniFile(); std::cout << "'help' displays a list of commands" << std::endl; commands(); return 0; }
void nrf5RadioInit(void) { dataInit(); nrf_802154_init(); }