Subversion Repositories Kolibri OS

Rev

Rev 2064 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2064 Rev 3924
Line 66... Line 66...
66
	//	Input:	graphic (Graphics)
66
	//	Input:	graphic (Graphics)
67
	//	Output:	none
67
	//	Output:	none
68
	//	Notes:	
68
	//	Notes:	
69
	//
69
	//
70
	void DrawBoard() {
70
	void DrawBoard() {
-
 
71
 
71
		int i;
72
		int i;
72
		for(i=0;i<=8;i++)  
73
		for(i=0;i<=8;i++)  
73
		{
74
		{
74
		  	__asm__ __volatile__("int $0x40"::"a"(38),"b"(320),"c"(YSHIFT+(YSHIFT+(40*i))*65536+40*i),"d"(0x555555));
75
		  	__asm__ __volatile__("int $0x40"::"a"(38),"b"(320),"c"(YSHIFT+(YSHIFT+(40*i))*65536+40*i),"d"(0x555555));
75
			__menuet__line((40*i),YSHIFT,(40*i),353,0x555555);				// horizontal
76
			__menuet__line((40*i),YSHIFT,(40*i),353,0x555555);				// horizontal
Line 487... Line 488...
487
				}
488
				}
488
			}
489
			}
489
//		} else {
490
//		} else {
490
//			ShowAbout();
491
//			ShowAbout();
491
		}
492
		}
-
 
493
 
-
 
494
                int _user = 0;
-
 
495
                int _computer = 0;
-
 
496
                int c, r;
-
 
497
 
-
 
498
                for (c=0; c<8; c++)
-
 
499
                    for (r=0; r<8; r++) {
-
 
500
                            if (TheBoard[c][r] == User)
-
 
501
                                       _user++;
-
 
502
                            if (TheBoard[c][r] == Computer)
-
 
503
                                       _computer++;
-
 
504
                            }
-
 
505
 
-
 
506
                // do not use sprintf function here please! ( sprintf(score, "User: %d - Computer: %d", _user, _computer); )
-
 
507
                char score[64];
-
 
508
                char tmp[8];
-
 
509
                strcpy(score, "User (black): ");
-
 
510
                itoa(_user++, tmp, 10);
-
 
511
                strcat(score, tmp);
-
 
512
                strcat(score, " - Computer (white): ");
-
 
513
                itoa(_computer++, tmp, 10);
-
 
514
                strcat(score, tmp);
-
 
515
 
-
 
516
                __menuet__bar(58, 8, 250, 16, 0x777777);
-
 
517
                __menuet__write_text(58,8,0x333333,score, strlen(score));
-
 
518
 
-
 
519
 
492
	}
520
	}
493
	// End of paint
521
	// End of paint
Line 494... Line 522...
494
 
522