void set_bgscreen (unsigned short *fbmem,int w,int h) { unsigned short pixel,i,j; pixel = rgb24_to16(189,121,50); for (j = 0; j < h;j++) fb_hline(fbmem,w,0,j,w-1,pixel); for (i = 1 ; i < 20;i++) { fb_hline (fbmem,w,100,30*i,670,0x3E0); fb_hline (fbmem,w,100,30*i+1,670,0xCCCC); } for (i = 0 ; i < 20;i++) { fb_vline (fbmem,w,100 + 30*i,30,571,0x3E0); fb_vline (fbmem,w,101 + 30*i,30,571,0xCCCC); } }
void draw_round(unsigned short * fbmem,int w,int x, int y,int ir,int color) { int ixo, iyo, ix1, ix2, iy1, iy2, ix; int y1; ixo = x; iyo = y; iy1 = iyo - ir; iy2 = iyo + ir; for(y1=iy1; y1<=iy2; y1++) { ix = ( pow(ir, 2) - pow(y1-iyo, 2) ) / 2; ix = (int)sqrt( pow(ir, 2) - pow(y1-iyo, 2) ); ix1 = ixo - ix; ix2 = ixo + ix; fb_hline (fbmem,w,ix1,y1,ix2,color); } }
int draw_board( int board[10][10] ) { int i, j; //4. draw pixel fb_pixel (fbmem,w,100,200,0xF800); fb_hline (fbmem,w,10,100,200,0x07E0); set_bgscreen (fbmem,w,h); for (i = 0; i < ROW; i++) { for (j = 0; j < COL; j++) /* if this pos is not empty */ if (board[i][j]) draw( i, j, board[i][j] ); } return 0; }
static void do_el_list_out( doc_element * array, uint8_t count ) { doc_element * cur_el; doc_element * save; int i; text_line * cur_line; /* Advise the user that multiple columns are not, in fact, implemented */ if( count > 1 ) { out_msg( "Multi-column output not implemented" ); } /* The array should have the doc_elements in linked-list form in the */ /* same order as the columns they came from were linked together. */ /* The columns should no longer point to these doc_element lists. */ for( i = 0; i < count; i++ ) { cur_el = &array[i]; while( cur_el != NULL ) { if( i == 0 ) { // restrict output to first column, for now switch( cur_el->type ) { case el_binc : if( GlobalFlags.lastpass ) { ob_binclude( &cur_el->element.binc ); } break; case el_dbox : // should only be found if DBOX block exists if( GlobalFlags.lastpass ) { fb_dbox( &cur_el->element.dbox ); } break; case el_graph : if( GlobalFlags.lastpass ) { if( ProcFlags.ps_device ) { // only available to PS device ob_graphic( &cur_el->element.graph ); } } break; case el_hline : // should only be found if HLINE block exists if( GlobalFlags.lastpass ) { fb_hline( &cur_el->element.hline ); } break; case el_text : if( GlobalFlags.lastpass ) { for( cur_line = cur_el->element.text.first; cur_line != NULL; cur_line = cur_line ->next ) { fb_output_textline( cur_line ); } } break; case el_vline : // should only be found if VLINE block exists if( GlobalFlags.lastpass ) { fb_vline( &cur_el->element.vline ); } break; default : internal_err( __FILE__, __LINE__ ); } } save = cur_el->next; cur_el->next = NULL; // clear only current element clear_doc_element( cur_el ); add_doc_el_to_pool( cur_el ); cur_el = save; } } return; }