Tetris

Check-in [0c7ebce22c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Streamline the source a bit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:0c7ebce22c322c480ace349899a0033b3469598742514af54534cad3d4c05efa
User & Date: ajv-899-334-8894@vsta.org 2008-10-26 18:55:54
Context
2008-10-26
19:35
Break out core game to its own routine check-in: b620c691f6 user: ajv-899-334-8894@vsta.org tags: trunk
18:55
Streamline the source a bit check-in: 0c7ebce22c user: ajv-899-334-8894@vsta.org tags: trunk
18:02
Tidy up comment check-in: 1bb2ec9c77 user: ajv-899-334-8894@vsta.org tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to screen.c.

363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
...
407
408
409
410
411
412
413
414
415
416
417

418
419
420
421
422
423
424
{

	putpad(CLstr);
	curscore = -1;
	memset((char *)curscreen, 0, sizeof(curscreen));
}

#if vax && !__GNUC__
typedef int regcell;	/* pcc is bad at `register char', etc */
#else
typedef cell regcell;
#endif

/*
 * Update the screen.
 */
void
scr_update()
{
	cell *bp, *sp;
	regcell so, cur_so = 0;
	int i, ccol, j;
	sigset_t sigset, osigset;
	static const struct shape *lastshape;

	sigemptyset(&sigset);
	sigaddset(&sigset, SIGTSTP);
	(void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
................................................................................
		static int r=5, c=2;
		int tr, tc, t; 

		lastshape = nextshape;
		
		/* clean */
		putpad(SEstr);
		moveto(r-1, c-1); putstr("          ");
		moveto(r,   c-1); putstr("          ");
		moveto(r+1, c-1); putstr("          ");
		moveto(r+2, c-1); putstr("          ");


		moveto(r-3, c-2);
		putstr("Next shape:");
						
		/* draw */
		putpad(SOstr);
		moveto(r, 2*c);







<
<
<
<
<
<






|
<







 







|
<
|
<
>







363
364
365
366
367
368
369






370
371
372
373
374
375
376

377
378
379
380
381
382
383
...
400
401
402
403
404
405
406
407

408

409
410
411
412
413
414
415
416
{

	putpad(CLstr);
	curscore = -1;
	memset((char *)curscreen, 0, sizeof(curscreen));
}







/*
 * Update the screen.
 */
void
scr_update()
{
	cell *bp, *sp, so, cur_so = 0;

	int i, ccol, j;
	sigset_t sigset, osigset;
	static const struct shape *lastshape;

	sigemptyset(&sigset);
	sigaddset(&sigset, SIGTSTP);
	(void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
................................................................................
		static int r=5, c=2;
		int tr, tc, t; 

		lastshape = nextshape;
		
		/* clean */
		putpad(SEstr);
		for (i = r-1; i <= r+2; ++i) {

		    moveto(i, c-1); putstr("          ");

		}

		moveto(r-3, c-2);
		putstr("Next shape:");
						
		/* draw */
		putpad(SOstr);
		moveto(r, 2*c);