// initialisation du simulateur vsd simuInit() { int i; colortabInit(); for(i=0;i<NBLED;i++) diodeval[i]=255; srand(GetTickCount()); #ifdef VL_MOTORS for(i=0;i<NBMOTOR;i++) { motorval[i]=60;//(rand()&255)*MAXMOTORVAL/256; motorcount[i]=motordir[i]=0; } for(i=0;i<256;i++) motorwheel[i]=0; for(i=0;i<MAXMOTORVAL;i++) { if ((i*2*NBHOLES/MAXMOTORVAL)&1) motorwheel[i]=1; if (i*NBHOLES/MAXMOTORVAL>=NBHOLES-MASKEDHOLES) motorwheel[i]=1; } #endif FirstInstance(); if (initBitmap ( )) return FALSE; mire(); if (initWindow()) return FALSE; winupdate(); // setButton(1); simuaudioinit(); simunetinit(); return 0; }
// initialisation du simulateur vsd simuInit() { int i; colortabInit(); for(i=0; i<NBLED; i++) { diodeval[i]=255; } srand(clock()); #ifdef VL_MOTORS for(i=0; i<NBMOTOR; i++) { motorval[i]=60;//(rand()&255)*MAXMOTORVAL/256; motorcount[i]=motordir[i]=0; } for(i=0; i<256; i++) { motorwheel[i]=0; } for(i=0; i<MAXMOTORVAL; i++) { if ((i*2*NBHOLES/MAXMOTORVAL)&1) { motorwheel[i]=1; } if (i*NBHOLES/MAXMOTORVAL>=NBHOLES-MASKEDHOLES) { motorwheel[i]=1; } } #endif // setButton(1); simuaudioinit(); simunetinit(); return 0; }