/* *---------------------------------------------------------------------------- * Main loop (when paused) * Return value: 0 = continue, not 0 = finish *---------------------------------------------------------------------------- */ int vgs2_pause() { static struct InputInf pi; struct InputInf ci; int push_flag=0; int push=0; int i; vgs2_touch(&ci.s,&ci.cx,&ci.cy,&ci.dx,&ci.dy); if(0==ci.s && 0!=pi.s) { push_flag=1; ci.s=1; ci.cx=pi.cx; ci.cy=pi.cy; } memcpy(&pi,&ci,sizeof(pi)); vgs2_boxfSP(0,0,XSIZE,YSIZE,5); vgs2_boxfSP(30,40,130,160,12); vgs2_boxSP(28,38,132,162,105); myprint(45,46,"- PAUSE -"); for(i=0;i<3;i++) { if(ci.s && HITCHK(40,60+i*33,80,25,ci.cx-4,ci.cy-4,8,8)) { vgs2_boxfSP(40,60+i*33,120,85+i*33,60); vgs2_boxSP(40,60+i*33,120,85+i*33,111); if(push_flag) { push=i+1; } } else { vgs2_boxfSP(40,60+i*33,120,85+i*33,8); vgs2_boxSP(40,60+i*33,120,85+i*33,107); } } myprint(57,70,"RESUME"); myprint(61,103,"RESET"); myprint(65,136,"EXIT"); if(push) { memset(&pi,0,sizeof(pi)); switch(push) { case 1: break; case 2: /* TODO: implement reset proceure */ break; case 3: return 1; } vgs2_setPause(0); } return 0; }
/* *---------------------------------------------------------------------------- * Main loop * Return value: 0 = continue, not 0 = finish *---------------------------------------------------------------------------- */ int vgs2_loop() { static int x,y; static struct InputInf pi; struct InputInf ci; vgs2_touch(&ci.s,&ci.cx,&ci.cy,&ci.dx,&ci.dy); if(pi.s==0 && ci.s!=0) vgs2_eff(0); memcpy(&pi,&ci,sizeof(ci)); x+=ci.dx; y+=ci.dy; myprint(x,y,"Hello,World!"); return 0; }