void display_status(int status) { int x_align, y_align ; int xy[8] ; char txt[50] ; switch (status ) { case STATUS_LOADING : strcpy( txt, "Loading..." ) ; break ; case STATUS_SCALING : strcpy( txt, "Scaling..." ) ; break ; case STATUS_WAITING : strcpy( txt, "Waiting..." ) ; break ; default : strcpy( txt, " " ) ; } vsf_color( handle, back_color ) ; vsf_interior( handle, FIS_SOLID ) ; vqt_extent( handle, txt, xy ) ; xy[2] = xy[4] ; xy[3] = xy[5] ; yprog = xy[3] + ttype.hcar ; v_hide_c(handle) ; vr_recfl( handle, xy ) ; v_show_c(handle, 1) ; vst_alignment( handle, 0, 1, &x_align, &y_align ) ; aff_text( txt, 0, ttype.hcar, txt_color ) ; vst_alignment( handle, x_align, y_align, &x_align, &y_align ) ; }
void display_stone( void ) { static int oldx, oldy; static long oldstone; int x, y; long thestone; int parray[4]; if (displayed) { vsf_color( handle, 0 ); for (y=0; y<4; y++) for (x=0; x<4; x++) { oldstone<<=1; if ( 0x10000L & oldstone ) { parray[0]=17+(16*(oldx+x)); parray[1]=17+(16*(oldy+y)); parray[2]=parray[0]+14; parray[3]=parray[1]+14; vr_recfl( handle, parray ); } } vsf_color( handle, 1 ); } thestone= stones[stone][mutation]; oldstone= thestone; oldx=stonex; oldy=stoney; displayed=1; for (y=0; y<4; y++) for (x=0; x<4; x++) { thestone<<=1; if ( 0x10000L & thestone ) { parray[0]=17+(16*(stonex+x)); parray[1]=17+(16*(stoney+y)); parray[2]=parray[0]+14; parray[3]=parray[1]+14; vr_recfl( handle, parray ); } } }
int cdecl draw_pencil(PARMBLK *parmblk) { WEXTENSION_PENCIL *wext = (WEXTENSION_PENCIL *) parmblk->pb_parm ; int xy[8] ; int xc, yc ; xy[0] = parmblk->pb_x ; xy[1] = parmblk->pb_y ; xy[2] = parmblk->pb_x+parmblk->pb_w-1 ; xy[3] = parmblk->pb_y+parmblk->pb_h-1 ; vs_clip(handle, 1, xy) ; xc = (xy[0]+xy[2])/2 ; yc = (xy[1]+xy[3])/2 ; vswr_mode(handle, MD_REPLACE) ; vsf_interior(handle, FIS_SOLID) ; vsf_color(handle, 0) ; vr_recfl(handle, xy) ; vsf_color(handle, wext->pencil.color) ; switch( wext->pencil.type ) { case 0 : xy[0] = xc-wext->pencil.height/2 ; xy[1] = yc-wext->pencil.height/2 ; xy[2] = xc+wext->pencil.height/2 ; xy[3] = yc+wext->pencil.height/2 ; vr_recfl(handle, xy) ; break ; case 1 : v_circle(handle, xc, yc, wext->pencil.height/2) ; break ; case 2 : xy[0] = xc ; xy[1] = yc-wext->pencil.height/2 ; xy[2] = xc+wext->pencil.height/2 ; xy[3] = yc ; xy[4] = xc ; xy[5] = yc+wext->pencil.height/2 ; xy[6] = xc-wext->pencil.height/2 ; xy[7] = yc ; v_fillarea(handle, 4, xy) ; break ; } vs_clip(handle, 0, xy) ; return(0) ; }
void OnDrawRTZoom(void *wnd, int xycoords[4]) { int xy[8] ; int index ; int must_fill = ( rtoffx > 0 ) || ( rtoffy > 0 ) ; if ( must_fill ) { if ( !Truecolor ) index = 0 ; else { int rgb[3] = { 1000, 1000, 1000 } ; index = 19 ; vs_color( handle, index, rgb ) ; } vswr_mode( handle, MD_REPLACE ) ; vsf_color( handle, index ) ; vsf_interior( handle, FIS_SOLID ) ; vsf_perimeter( handle, 0 ) ; } if ( intersect( rtx + rtoffx, rty + rtoffy, rtw - rtoffx, rth - rtoffy, xycoords[0], xycoords[1], xycoords[2], xycoords[3], &xy[4] ) ) { xy[0] = smart_offx + xy[4] - rtx - rtoffx ; xy[1] = xy[5] - rty - rtoffy ; xy[2] = smart_offx + xy[6] - rtx - rtoffx ; xy[3] = xy[7] - rty - rtoffy ; vro_cpyfm( handle, S_ONLY, xy, &RTZoomDst, &screen ) ; if ( must_fill ) { if ( intersect( rtx, rty, rtoffx, rth, xycoords[0], xycoords[1], xycoords[2], xycoords[3], xy ) ) vr_recfl( handle, xy ) ; if ( intersect( rtx, rty, rtw, rtoffy, xycoords[0], xycoords[1], xycoords[2], xycoords[3], xy ) ) vr_recfl( handle, xy ) ; } } }
/* Clear given area of screen */ void clear_area (int app_handle, int x, int y, int w, int h) { int pxy[4]; vsf_interior (app_handle, SOLID); vsf_color (app_handle, WHITE); pxy[0] = x; pxy[1] = y; pxy[2] = x + w - 1; pxy[3] = y + h - 1; vr_recfl (app_handle, pxy); }
void sldcls_screen( VSS_INFO *vss_info, INFO_IMAGE *inf ) { int xyarray[4] ; compute_colors( vss_info, inf ) ; if ( !vss_info->do_not_cls_scr ) { xyarray[0] = 0 ; xyarray[1] = 0 ; xyarray[2] = Xmax ; xyarray[3] = Ymax ; vsf_color( handle, back_color ) ; vsf_interior( handle, FIS_SOLID ) ; if ( !vss_info->do_not_show_mouse ) v_hide_c(handle) ; vr_recfl(handle, xyarray) ; if ( !vss_info->do_not_show_mouse ) v_show_c(handle, 1) ; } }
LOCAL VOID bb_fill(WORD mode, WORD fis, WORD patt, WORD hx, WORD hy, WORD hw, WORD hh) { gsx_fix(&gl_dst, 0x0L, 0, 0); ptsin[0] = hx; ptsin[1] = hy; ptsin[2] = hx + hw - 1; ptsin[3] = hy + hh - 1; gsx_attr(TRUE, mode, gl_tcolor); if (fis != gl_fis) { vsf_interior(gl_handle, fis); gl_fis = fis; } if (patt != gl_patt) { vsf_style( gl_handle, patt ); gl_patt = patt; } vr_recfl(gl_handle, &ptsin[0]); }
void clear_line( void ) { int i; int count=0; for( i=0; i<HEIGHT; i++ ) { if (playfield[i]==((1<<WIDTH)-1)) { int x,j; int parray[4]; count++; for(j=i; j>=0; j--) { playfield[j]=playfield[j-1]; for (x=0; x<WIDTH; x++) { if (playfield[j]&(1<<x)) vsf_color( handle, 1 ); else vsf_color( handle, 0 ); parray[0]=17+(16*x); parray[1]=17+(16*j); parray[2]=parray[0]+14; parray[3]=parray[1]+14; vr_recfl( handle, parray ); } } vsf_color( handle, 0 ); parray[1]=17; parray[3]=parray[1]+14; for (x=0; x<WIDTH; x++) { parray[0]=17+(16*x); parray[2]=parray[0]+14; vr_recfl( handle, parray ); } vsf_color( handle, 1 ); playfield[0]=0; } } switch (count) { case 1: score+=1; break; case 2: score+=3; break; case 3: score+=7; break; case 4: score+=15; break; } if (score>scorebound) { scorebound+=SCBOUND; zeit=zeit*TIMEACC; } }
void specific_note_draw(ALWINDOW *alw, CURRENT_STATUS *cs,int specific_note) { register int loop1,loop2; int cf; short coord[4]; register int curx,cury; int half_fret_height=frets_height/2,half_fret_length=frets_length/2; register int circle_radius; int combination_note,note_val; int frets_length_times_loop2,half_fret_height_and_frets_y_offset; short tatts[10]; /* text attributes */ NOTE *np; char albuff[10]; #define draw(X1,Y1,X2,Y2); coord[0]=X1;coord[1]=Y1;coord[2]=X2;coord[3]=Y2;v_pline(handle,2,coord); scale_offsets(alw,&frets_x_offset,&frets_y_offset); frets_y_offset=frets_y_offset+big_y_offset; half_fret_height_and_frets_y_offset=half_fret_height+frets_y_offset; if(frets_length>frets_height) circle_radius=(frets_height/2)-1-2; else circle_radius=(frets_length/2)-1-2; vqt_attributes(handle,tatts); wclip(alw); graf_mouse(M_OFF,NULL); for(loop2=0;loop2<global_frets && loop2+start_fret<global_frets;loop2++) { frets_length_times_loop2=frets_length*loop2; for(loop1=0;loop1<6;loop1++) { cf=loop2+start_fret; curx=(loop2*frets_length); cury=(loop1*frets_height); if(cs->current_fretboard[loop1][cf]->number==specific_note) { /* vsf_color(handle,WHITE); vsf_interior(handle,FIS_SOLID); vsf_style(handle,1); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius+2); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); */ /* Wipe out the old note */ coord[0]=curx+frets_x_offset+1; coord[1]=cury+frets_y_offset; coord[2]=curx+frets_x_offset+frets_length-1; coord[3]=cury+frets_height+frets_y_offset; vsf_color(handle,WHITE); vsf_interior(handle,FIS_SOLID); vsf_style(handle,1); vr_recfl(handle,coord); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); /* if the current fret is 0 then it is the open notes only draw the string if it is not the open note */ if(cf!=0) { draw(curx+frets_x_offset, cury+half_fret_height+frets_y_offset, curx+frets_length+frets_x_offset, cury+half_fret_height+frets_y_offset); } /* draw the note */ if(text_notes==1) { combination_note=0; if(cs->display_fretboard[loop1][cf]>RELATIVE_NOTE) { combination_note=1; note_val=cs->display_fretboard[loop1][cf]-RELATIVE_NOTE; } else { note_val=cs->display_fretboard[loop1][cf]; } switch(note_val) { case NO_NOTE: break; case NORMAL_NOTE: if(combination_note) vst_effects(handle,0|UNDERLINED); else vst_effects(handle,0); break; case FILLED_NOTE: if(combination_note) vst_effects(handle,OUTLINE|UNDERLINED); else vst_effects(handle,OUTLINE); break; case RELATIVE_NOTE: vst_effects(handle,UNDERLINED); break; } /* draw as text */ if(cs->display_fretboard[loop1][cf]!=NO_NOTE) { np=cs->current_fretboard[loop1][cf]; sprintf(albuff,"%s",np->note_name); if(strlen(albuff)==1) v_gtext(handle,frets_x_offset+frets_length_times_loop2+half_fret_length-(tatts[6]/2), cury+half_fret_height_and_frets_y_offset+(tatts[7]/2)/*cury+frets_y_offset+frets_height*/,albuff); else v_gtext(handle,/*curx+frets_x_offset*/frets_x_offset+(frets_length_times_loop2)+half_fret_length-tatts[6], cury+half_fret_height_and_frets_y_offset+(tatts[7]/2)/*cury+frets_y_offset+frets_height*/,albuff); } vst_effects(handle,0); } else { combination_note=0; if(cs->display_fretboard[loop1][cf]>RELATIVE_NOTE) { combination_note=1; note_val=cs->display_fretboard[loop1][cf]-RELATIVE_NOTE; } else { note_val=cs->display_fretboard[loop1][cf]; } if(combination_note) { vsf_color(handle,BLACK); vsf_interior(handle,FIS_HOLLOW); vsf_style(handle,0); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius+2); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); } switch(note_val) { case NO_NOTE: /* vsf_color(handle,WHITE); vsf_interior(handle,FIS_SOLID); vsf_style(handle,1); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); if(cf!=0) { draw(curx+frets_x_offset, cury+half_fret_height+frets_y_offset, curx+frets_length+frets_x_offset, cury+half_fret_height+frets_y_offset); }*/ break; case NORMAL_NOTE: /* if(cf!=0) { draw(curx+frets_x_offset, cury+half_fret_height+frets_y_offset, curx+frets_length+frets_x_offset, cury+half_fret_height+frets_y_offset); } */ vsf_color(handle,BLACK); vsf_interior(handle,2); vsf_style(handle,2); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); break; case FILLED_NOTE: /* if(cf!=0) { draw(curx+frets_x_offset, cury+half_fret_height+frets_y_offset, curx+frets_length+frets_x_offset, cury+half_fret_height+frets_y_offset); } */ vsf_color(handle,BLACK); vsf_interior(handle,FIS_SOLID); vsf_style(handle,2); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius); vsf_color(handle,BLACK); break; case RELATIVE_NOTE: /* if(cf!=0) { draw(curx+frets_x_offset, cury+half_fret_height+frets_y_offset, curx+frets_length+frets_x_offset, cury+half_fret_height+frets_y_offset); } */ vsf_color(handle,BLACK); vsf_interior(handle,FIS_HOLLOW); vsf_style(handle,0); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); break; /* case COMMON_NOTE: vsf_color(handle,BLACK); vsf_interior(handle,4); vsf_style(handle,2); alcircle(handle, curx+half_fret_length+frets_x_offset, cury+half_fret_height+frets_y_offset, circle_radius); vsf_color(handle,BLACK); vsf_interior(handle,8); vsf_style(handle,2); break; */ } } } } } graf_mouse(M_ON,NULL); }