Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1385 → Rev 1386

/demos/trunk/base/cabs.c
34,7 → 34,7
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
* CVS : $Id: cabs.c,v 1.5 2004-04-18 19:46:29 giacomo Exp $
* CVS : $Id: cabs.c,v 1.6 2004-04-19 14:11:07 giacomo Exp $
*/
 
/*--------------------------------------------------------------*/
123,9 → 123,9
 
grx_clear(BLACK);
 
grx_text("Press a key [1-4]", 10, 16, 7, 0);
grx_text("to create a pair", 10, 24, 7, 0);
grx_text("ESC to exit demo", 10, 48, 7, 0);
grx_text("Press a key [1-4]", 10, 16, rgb16(255,255,255), 0);
grx_text("to create a pair", 10, 24, rgb16(255,255,255), 0);
grx_text("ESC to exit demo", 10, 48, rgb16(255,255,255), 0);
 
while (c != 27) {
c = keyb_getch(BLOCK);
151,7 → 151,7
char s[2]; /* string to display */
int k = 0;
int x, y;
int col = 13;
int col = rgb16(0,0,255);
int ybase = YY + i*DELTA;
 
x = X1;
269,23 → 269,23
char buffer[32]; /* buffer per sprintf */
int yc = YP + i*DELTA; /* altezza del canale */
 
grx_circle(XP1,yc,R,2);
grx_text("P1",XP1-8,yc-4,12,0);
grx_circle(XP1,yc,R,rgb16(255,0,0));
grx_text("P1",XP1-8,yc-4,rgb16(255,255,255),0);
 
grx_circle(XP2,yc,R,2);
grx_text("P2",XP2-8,yc-4,12,0);
grx_circle(XP2,yc,R,rgb16(255,0,0));
grx_text("P2",XP2-8,yc-4,rgb16(255,255,255),0);
 
grx_rect(XC,yc-R,XC+L,yc+R,3);
grx_text("CAB",XC+16,yc-4,12,0);
grx_rect(XC,yc-R,XC+L,yc+R,rgb16(255,255,255));
grx_text("CAB",XC+16,yc-4,rgb16(255,255,255),0);
 
grx_line(XP1+R,yc,XC,yc,4);
grx_line(XC+L,yc,XP2-R,yc,4);
grx_line(XP1+R,yc,XC,yc,rgb16(255,255,255));
grx_line(XC+L,yc,XP2-R,yc,rgb16(255,255,255));
 
grx_text("T1 = ms",X1+40,yc+R+16,14,0);
grx_text("T1 = ms",X1+40,yc+R+16,rgb16(255,255,255),0);
sprintf(buffer,"%ld", t1[i]);
grx_text(buffer,X1+88,yc+R+16,14,0);
grx_text(buffer,X1+88,yc+R+16,rgb16(255,255,255),0);
 
grx_text("T2 = ms",X2+40,yc+R+16,14,0);
grx_text("T2 = ms",X2+40,yc+R+16,rgb16(255,255,255),0);
sprintf(buffer,"%ld", t2[i]);
grx_text(buffer,X2+88,yc+R+16,14,0);
grx_text(buffer,X2+88,yc+R+16,rgb16(255,255,255),0);
}
/demos/trunk/base/fly.c
18,11 → 18,11
 
/**
------------
CVS : $Id: fly.c,v 1.6 2004-04-19 13:54:16 giacomo Exp $
CVS : $Id: fly.c,v 1.7 2004-04-19 14:11:07 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.6 $
Last update: $Date: 2004-04-19 13:54:16 $
Revision: $Revision: 1.7 $
Last update: $Date: 2004-04-19 14:11:07 $
------------
**/
 
88,7 → 88,7
int x, y;
int ox, oy;
int dx, dy, da;
int teta, col;
int teta, col,red;
int outx, outy;
double r;
int i = (int)arg;
96,7 → 96,8
x = ox = (XMIN+XMAX)/2;
y = oy = (YMIN+YMAX)/2;
teta = 0;
col = 2 + i; /* colore fly */
red = 50+10*i;
col = rgb16(red,0,50); /* colore fly */
 
while (1) {
 
150,10 → 151,10
TIME seme; /* used to init the random seed */
 
/* The scenario */
grx_rect(XMIN-D-1, YMIN-D-1, XMAX+D+1, YMAX+D+1, 14);
grx_text("Simulation of Random Flies", XMIN, YMENU+10, 13, 0);
grx_text("SPACE create a fly" , XMIN, YMENU+20, 12, 0);
grx_text("ESC exit to DOS" , XMIN, YMENU+30, 12, 0);
grx_rect(XMIN-D-1, YMIN-D-1, XMAX+D+1, YMAX+D+1, rgb16(255,255,255));
grx_text("Simulation of Random Flies", XMIN, YMENU+10, rgb16(255,255,255), 0);
grx_text("SPACE create a fly" , XMIN, YMENU+20, rgb16(255,255,255), 0);
grx_text("ESC exit to DOS" , XMIN, YMENU+30, rgb16(255,255,255), 0);
 
/* The program waits a space to create a fly */
c = keyb_getch(BLOCK);