예제 #1
0
void startLogo()
{
	setcursortype(NOCURSOR);

	Sleep(500);
	textcolor(8);
	gotoxy(31, 10), printf("ⓒ 2015 Naissoft");
	Sleep(50);
	textcolor(7);
	gotoxy(31, 10), printf("ⓒ 2015 Naissoft");
	Sleep(50);
	textcolor(15);
	gotoxy(31, 10), printf("ⓒ 2015 Naissoft");
	Sleep(600);
	textcolor(7);
	gotoxy(31, 10), printf("ⓒ 2015 Naissoft");
	Sleep(50);
	textcolor(8);
	gotoxy(31, 10), printf("ⓒ 2015 Naissoft");
	Sleep(50);
	system("cls");
	textcolor(7);
	Sleep(200);

	setcursortype(NORMALCURSOR);
}
예제 #2
0
static boolean tableverbadjustcursor (Point pt) {
	
	register hdltableformats hf = tableformatsdata;
	short col;
	
	if (pointinrect (pt, (**hf).tablerect)) {
		
		if (tablefindcolumnguide (pt, &col)) {
			
			setcursortype (cursorisverticalrails);
			
			return (true);
			}
				
		return (opsetcursor (pt));
		}
	
	if (adjustpopupcursor (pt, (**hf).kindpopuprect))
		return (true);
	
	if (adjustpopupcursor (pt, (**hf).sortpopuprect))
		return (true);
	
	setcursortype (cursorisarrow);
	
	return (true);
	} /*tableverbadjustcursor*/
예제 #3
0
파일: 소스.c 프로젝트: nwk1541/c_project
int main(void)
{
	int i;

	srand((unsigned)time(NULL));
	setcursortype(NOCURSOR);
	draw_title(); 
	reset();

	while (1)
	{
		for (i = 0; i<5; i++) //블록이 한칸떨어지는동안 5번 키입력받을 수 있음 
		{ 
			process_key(); //키입력확인 
			draw_game();
			Sleep(speed);
			if (crush_on&&check_crush(bx, by + 1, b_rotation) == false) 
				Sleep(100); //블록이 충돌중인경우 추가로 이동및 회전할 시간을 갖음
			if (space_key_on == 1) //스페이스바를 누른경우(hard drop) 추가로 이동및 회전할수 없음 break; 
			{ 
				space_key_on = 0;
				break;
			}
		}
		move_down();  
		check_level_up(); 
		check_game_over(); 
		if (new_block_on == 1)
			new_block(); // 뉴 블럭 flag가 있는 경우 새로운 블럭 생성 
	}
}
예제 #4
0
int main() {                                   /*-----------------------------------     main function     -----------------------------------*/ 
	int start_games=1;
	int i=0;
	int x=8; // x좌표 키값받아서 움직임( 기본값 : 8 ) 
	srand((unsigned)time(NULL));
	setcursortype(NOCURSOR);
	StartScreen();

	for(i=0;i<1001; i++) {
		check_crash();
		if(stop==1||start_games==1) { // 블럭 충돌시 또는 게임 시작 시 
			block_type=rand()%7; 
			x=8;
			new_block(x,block_height); // 기본위치에 블럭 생성 
			start_games=0;
			stop=0;
		}
		if(i==10){
			i=0;
			Sleep(10);
			if(stop==0){
				block_height+=1;
			}
		}
		new_block(x,block_height);
		Sleep(10);
	}

	getch();
	return 0;
}
예제 #5
0
static boolean langerroradjustcursor (Point pt) {
		
	if (pointinrect (pt, (**langerrordata).iconrect)) {
		
		if (!(**langerrordata).flcallbackconsumed) {
		
			setcursortype (cursorisgo);
			
			return (true);
			}
		}
		
	setcursortype (cursorisarrow);
	
	return (true);
	} /*langerroradjustcursor*/
예제 #6
0
boolean tablesetsortorder (hdlhashtable ht, short sortorder) {
	
	/*
	3/23/93 dmb: set watch cursor before sorting
	*/
	
	register hdltableformats hf = (hdltableformats) (**ht).hashtableformats;
	
	(**ht).sortorder = sortorder;
	
	if (hf != nil) {
		
		invalrect ((**hf).titlerect);
		
		setcursortype (cursoriswatch);
		
		shellforcecursoradjust (); /*make sure it reverts ASAP*/
		
		tableresort (ht, nil);
		
		opvisibarcursor ();
		}
	
	return (true);
	} /*tablesetsortorder*/
예제 #7
0
boolean clickcolorpopup (Point pt, RGBColor *rgb) {
	
	long result;
	short lo, hi;
	
	if (!flpopupinit)
		flpopupinit = initcolorpopup ();
	
	setcursortype (cursorisarrow);
	
	CalcMenuSize (colormenu);
	
	InsertMenu (colormenu, hierMenu);

	LocalToGlobal (&pt);
	
	result = PopUpMenuSelect (colormenu, pt.v, pt.h, -1);

	DeleteMenu ((**colormenu).menuID);
	
	lo = LoWord (result);
	
	hi = HiWord (result);
	
	if (hi > 0) { /*something was selected*/
	
		*rgb = (*ctable) [lo - 1].rgb;
		
		return (true);
		}
	
	return (false);
	} /*clickcolorpopup*/
예제 #8
0
int main() {                                                    /*------------------------------main function------------------------------*/
	setcursortype(NOCURSOR);
	create_world();
	int i;
	srand((unsigned)time(NULL));
	for(;;) {
		ModTick();
		check_wall();//checck_crash
		set_block();
		new_block();
		check_move();//move_block();
		i++;
		Sleep(1);
		if (i>399) {
			i=0;
			move_block(DOWN);
		}
		gotoxy(0,0);
		printf("%3d",b_x);
		gotoxy(0,1);
		printf("%3d",b_y);
		gotoxy(0,3);
		printf("%3d",b_type);
	}


	gotoxy(0,0);
	getch();
}                                                               /*------------------------------main function------------------------------*/
예제 #9
0
void credits()
{
    setcursortype(NOCURSOR);
    printf("The game is made by international team of students from:");
    Sleep( 1500 );
    system( "cls" );
    printf("\tItaly");
    Sleep( 1500 );
    printf("\n\nFederico Bollotta");
    printf("\n  Lorenzo Romanelli");
    printf("\n");
    Sleep( 3000 );
    system( "cls" );
    printf("\tPoland");
    Sleep( 1500 );
    printf("\n\nLukasz Czechowicz");
    printf("\n  Anna Gil");
    printf("\n    Konrad Dziurdz");
    printf("\n");
    Sleep( 3000 );
    system( "cls" );
    printf("\tPortugal");
    Sleep( 1500 );
    printf("\n\nDaniel Pinto");
    printf("\n  Nuno Valente");
    printf("\n    Roberto Ribeiro");
    printf("\n");
    Sleep( 3000 );
    system( "cls" );
    printf("Coordinator of the project was Mr. Pawel Lempa and Mr. Grzegorz Filo");
    Sleep( 3000 );
    system( "cls" );
    printf("\n Thanks to ERASMUS IP Lifelong Learning Programme");
    Sleep( 4000 );

    printf("\n\n \tLeiria, Portugal 2014");

    printf("\n\n \tPress any button to back to menu");
    setcursortype(NORMALCURSOR);
    getch();
    return(0);

}
예제 #10
0
static boolean miniadjustcursor (Point pt){
	
	if (minifindtextobject (pt) >= 0) {
			
		setcursortype (cursorisibeam);
			
		return (true);
		}
		
	if (minifindpopup (pt) >= 0) {
		
		setcursortype (cursorispopup);
		
		return (true);
		}
		
	setcursortype (cursorisarrow);
	
	return (true);
	} /*miniadjustcursor*/
예제 #11
0
void rollbeachball (void) {
	
	tycursortype state;
	
	if (rollingtimerexpired ()) {
	
		state = (tycursortype) (beachballstate + 1);
		
		if (state > cursorisbeachball4) 
			state = cursorisbeachball1;
		
		setcursortype (state);
		
		beachballstate = state;
		}
	} /*rollbeachball*/
예제 #12
0
void rollearth (void) {
	
	tycursortype state;
	
	if (rollingtimerexpired ()) {
	
		state = (tycursortype) (earthstate + 1); 
		
		if (state > cursorisearth7) /*wrap around*/
			state = cursorisearth1;
						
		setcursortype (state);
		
		earthstate = state;
		}
	} /*rollearth*/
예제 #13
0
int main() {

	int x, y; //플레이어의 실시간좌표

	setcursortype(NOCURSOR);

	LoadingStage();

	Round = 0;

	while (1) {
		memcpy(stage, StageData[Round], sizeof(stage));

		clrscr();


		for (y = 0; y < 18; y++) {

			for (x = 0; x < 20; x++) {

				if (stage[y][x] == '@') {

					Rx = x; //플레이어 좌표지정
					Ry = y; //플레이어 좌표지정
					stage[y][x] = ' '; //공백으로 지우기

				}

			}
		}

		while (1) {

			DrawStage();
			PlayerMove();
		}
	}

	

	getchar();
	return 0;

}
예제 #14
0
파일: main.c 프로젝트: woaks223/Tetris
void main() {
	char choice;
	setcursortype(NOCURSOR);
	choice = start();
	_beginthread(auto_down_blcok, 0, 0);
	if (choice == '1') {
		map_reset();
		while (1) {
			map();
			if (new_block_on == 1) new_block();
			key_ent();

		}
	}
	else {
		exit(1);
	}
	return;
}
예제 #15
0
파일: icon.c 프로젝트: pombredanne/Frontier
boolean trackicon (Rect r, void (*displayiconcallback) (boolean)) {
	
	/*
	this is really more general than its name implies, but for now 
	it covers the common calling mousetracking conventions use by 
	all the windoid icons, and belongs here.
	
	12/12/90 dmb: if mousetrack returns false, icon has already been displayed 
	in off state, and shouldn't be redisplayed (in case callback uses simple 
	inversion)
	*/
	
	setcursortype (cursorisarrow); /*get rid of funny appendage*/
	
	(*displayiconcallback) (true); /*show icon in depressed state*/
	
	if (!mousetrack (r, displayiconcallback)) /*if false, mouse didn't stay in rectangle*/
		return (false);
	
	(*displayiconcallback) (false); /*show icon in un-depressed state*/
	
	return (true);
	} /*trackicon*/
예제 #16
0
static void shelldefaultadjustcursor (void) {
	
	setcursortype (cursorisarrow);
	} /*shelldefaultadjustcursor*/
예제 #17
0
static boolean langerrormousedown (Point pt, tyclickflags flags) {
#pragma unused (flags)

	/*
	7/16/90 DW: wired off the consumption of the error callback, if you want
	it back on, just switch on the code that's commented out, and the script
	icon will go dim, the cursor adjustment won't happen, and no mouseclicks
	will be handled for clicking on the script button.
	
	4.1b4 dmb: use custom tracking code so we can popup a menu after mouse has
	been down a fraction of a second.
	*/
	
	register hdllangerrorrecord hle = langerrordata;
	Rect r;
	boolean flinrectnow, flwasinrect;
	boolean flconsumed = false;
	unsigned long timemoved;
	short threshhold = getmousedoubleclicktime () * 2 / 3;
	
	if ((**hle).flcallbackconsumed)
		return (false);
	
	r = (**hle).iconrect;
	
	if (pointinrect (pt, r)) {
		
		setcursortype (cursorisarrow); /*get rid of funny appendage*/
		
		langerrordrawicon (true); /*show icon in depressed state*/
		
	//	if (!mousetrack (r, langerrordrawicon)) /*if false, mouse didn't stay in rectangle*/
	//		return (false);
		
		flwasinrect = true; /*at least for the first iteration of loop*/
		
		timemoved = gettickcount ();
		
		while (mousestilldown ()) { /*stay in holding pattern*/
		
			getmousepoint (&pt);
			
			flinrectnow = pointinrect (pt, r);
			
			if (flinrectnow != flwasinrect)	{
			
				langerrordrawicon (flinrectnow);
				
				timemoved = gettickcount ();
				}
			else if (flinrectnow && gettickcount () - timemoved > (unsigned) threshhold) {
				
				langerrorpopupmenu ();
				
				flconsumed = true;
				}
			
			flwasinrect = flinrectnow;
			} /*while*/
		
		if (flwasinrect) {
		
			langerrordrawicon (false); /*show icon in un-depressed state*/
			
			if (!flconsumed)
				langerrorbuttonhit ();
			}
		}
	
	return (true);
	} /*langerrormousedown*/
예제 #18
0
boolean shellprint (WindowPtr w, boolean fldialog) {

	/*
	9/5/90 dmb:  open and close print resources each time we're called.  also, 
	make sure we close each page opened, even when errors occur
	
	9/28/91 dmb: for exit of edit mode before printing
	
	4/24/92 dmb: make sure bJDocLoop is bSpoolLoop before calling PrPicFile, as 
	per IM II-155.  otherwise, we can get bogus PrErrors
	*/

	OSStatus 		theErr;
	boolean			accepted;

	//remember that this is a grafport, TPPrPort isn't
	//but this should work because all the code that
	//messes with printing uses a grafport. 

	// CGrafPtr			printport;
	UInt32
		minPage = 1,
		maxPage = 9999;

	SInt32	firstPage = 1;
	SInt32	lastPage = 9999;

	short i;
	boolean fl = false;
	
	if (w == nil) /*defensive driving*/
		return (false);

	if (!carbonValidSession())
	{
		carbonStdSetup();
	}
	
	fl = false; /*until sucessfull print, this is return value*/
	
	/*fills in fields of printinfo record*/
	(*shellglobals.setprintinfoproutine) ();

	//this only counts the number of pages.
	maxPage = shellprintinfo.ctpages;
	
	//set the page range
	theErr = PMSetPageRange(shellprintinfo.printsettings, minPage, maxPage);
	if(theErr != noErr){
		goto exit;
	}

	//finally display the dialog
	if (fldialog)
	{
		theErr = PMSessionPrintDialog(
							 shellprintinfo.printhandle,
							 shellprintinfo.printsettings,
							 shellprintinfo.pageformat,
							&accepted);

		//either the user canceled or their was some other error.
		//don't print
		if (!accepted || (theErr != noErr)){
			goto exit;
		}
	}

	setcursortype (cursoriswatch);

	shellupdateallnow (); /*update all windows that were dirtied by the print dialog*/

	shellpushglobals (w);

	(*shellglobals.settextmoderoutine) (false); /*make sure editing changes are accepted*/

	pushport (nil); /*save current port on stack*/

	//Code change by Timothy Paustian Friday, June 16, 2000 4:19:04 PM
	//Changed to Opaque call for Carbon
	//I will have to watch out for this,
	//to save the port I need to use..
	//PMSessionGetGraphicsContext (
	//This does not return the printport, but TPrPort gPort field
	//I think I can get away with this because the only function that uses
	//it is pgInitDevice and that assumes you are passing a port.
	//It is OK in the old code because the first item in the struct is a port

	//we have to call this first before we can get the graphics context
	theErr = PMSessionBeginDocument(
							shellprintinfo.printhandle,
							shellprintinfo.printsettings,
							shellprintinfo.pageformat);

	if(theErr != noErr)
		goto exit;

	/*prepares for printing*/
	(*shellglobals.beginprintroutine) ();

	/*fills in fields of printinfo record*/
	// (*shellglobals.setprintinfoproutine) ();
	//this only counts the number of pages.
	
	//limit this to the number of pages the user asked for. 

	theErr = PMGetFirstPage(shellprintinfo.printsettings, (UInt32 *) (&firstPage));
	if (theErr == noErr)
	{
		theErr = PMGetLastPage(shellprintinfo.printsettings, (UInt32 *) (&lastPage));
	}

	//sanity checks
	if(theErr != noErr)
		goto exit;

	if(lastPage > shellprintinfo.ctpages)
		lastPage = shellprintinfo.ctpages;

	for (i = 1; i <= lastPage; i++) { /*print one page*/

		theErr = PMSessionBeginPage(
							 shellprintinfo.printhandle,
							 shellprintinfo.pageformat,
							&shellprintinfo.pagerect);

		if (theErr != noErr)
			break;
		
		//now set the graphics context.
		//in carbon we have to set up the port each time
		//to make sure it is in the printer port. Since other things can be going on
		//during the printing, the port may have changed.
		{
			GrafPtr thePort, oldPort;

			GetPort(&oldPort);

			//the second parameter is currently ignored.
			theErr = PMSessionGetGraphicsContext(
									shellprintinfo.printhandle,
									kPMGraphicsContextQuickdraw,
									(void **) &thePort);

			shellprintinfo.printport = thePort;

			SetPort(thePort);

			// Draw the page
			SetFractEnable (true);

			fl = (*shellglobals.printroutine) (i);

			//reset back to the old port.
			SetPort(oldPort);
		}

		theErr = PMSessionEndPage(shellprintinfo.printhandle);

		if (!fl)
			break;

		if (keyboardescape ())
		{
			theErr = PMSessionSetError(shellprintinfo.printhandle, iPrAbort);
		}
	} /*for*/

	theErr = PMSessionEndDocument(shellprintinfo.printhandle);

	if(theErr !=  noErr)
		goto exit;

	//everything worked and printing is done. so set fl to true.
	fl = true;

	//the PrPicFile is not supported in carbon.

	popport ();

	(*shellglobals.endprintroutine) ();

	shellpopglobals ();

exit:

	carbonKillPrintVars();
//	PMRelease(shellprintinfo.printhandle);
//	PMRelease(pageformat);
//	PMRelease(printsettings);

	currentprintport = NULL;

	return (fl);

	} /*shellprint*/
예제 #19
0
boolean shellprint (WindowPtr w, boolean fldialog) {
	
	/*
	 9/5/90 dmb:  open and close print resources each time we're called.  also, 
	 make sure we close each page opened, even when errors occur
	 
	 9/28/91 dmb: for exit of edit mode before printing
	 
	 4/24/92 dmb: make sure bJDocLoop is bSpoolLoop before calling PrPicFile, as 
	 per IM II-155.  otherwise, we can get bogus PrErrors
	 */

	
	PRINTDLG pd;
	DOCINFO di;
	HDC printport;
	hdlwindowinfo hinfo;
	
	short i;
	boolean fl = false;
	
	if (w == nil) /*defensive driving*/
		return (false);
	
	fl = false; /*until sucessfull print, this is return value*/

	ZeroMemory (&pd, sizeof (PRINTDLG));
	pd.lStructSize = sizeof (PRINTDLG);
	pd.hwndOwner = hwndMDIClient;
	pd.Flags = PD_RETURNDC;
	
	if (!fldialog)
		pd.Flags = pd.Flags | PD_RETURNDEFAULT;
	
	if (! PrintDlg (&pd)) {
		goto exit;
	}
	
	setcursortype (cursoriswatch);
	
	shellupdateallnow (); /*update all windows that were dirtied by the print dialog*/
	
	shellpushglobals (w);
	
	(*shellglobals.settextmoderoutine) (false); /*make sure editing changes are accepted*/
		
	di.cbSize = sizeof(DOCINFO);
	di.lpszDocName = "Frontier Document";
	di.lpszOutput = NULL;
	di.lpszDatatype = NULL;
	di.fwType = 0;
	
	shellprintinfo.printport = printport = pd.hDC;
	shellprintinfo.scaleMult = GetDeviceCaps(pd.hDC, LOGPIXELSX);
	shellprintinfo.scaleDiv = GetDeviceCaps(getcurrentDC (), LOGPIXELSX);
	
	StartDoc (printport, &di);
	winpushport (w, printport);
	currentprintport = w;
	
	getwindowinfo (w, &hinfo);
	
	
	/*prepares for printing*/
	(*shellglobals.beginprintroutine) ();
	
	/*fills in fields of printinfo record*/
	(*shellglobals.setprintinfoproutine) ();
	//this only counts the number of pages.
	
	
	for (i = 1; i <= shellprintinfo.ctpages; i++) { /*print one page*/
		
		if (StartPage(shellprintinfo.printport) > 0) {
			fl = (*shellglobals.printroutine) (i);
		}
		
		EndPage (shellprintinfo.printport);
		
		if (!fl)
			break;
	} /*for*/
	
	
	EndDoc (printport);
	
	winpopport();
	
	currentprintport = NULL;
	
	DeleteDC (printport);
	
	
	(*shellglobals.endprintroutine) ();
	
	shellpopglobals ();
	
exit:
	currentprintport = NULL;

	return (fl);

} /*shellprint*/
예제 #20
0
boolean shellprint (WindowPtr w, boolean fldialog) {

	/*
	9/5/90 dmb:  open and close print resources each time we're called.  also, 
	make sure we close each page opened, even when errors occur
	
	9/28/91 dmb: for exit of edit mode before printing
	
	4/24/92 dmb: make sure bJDocLoop is bSpoolLoop before calling PrPicFile, as 
	per IM II-155.  otherwise, we can get bogus PrErrors
	*/

	// classic mac
	TPPrPort printport;
	TPrStatus printstatus;
	THPrint hp = shellprintinfo.printhandle;

	SInt32	firstPage = 1;
	SInt32	lastPage = 9999;

	short i;
	boolean fl = false;
	
	if (w == nil) /*defensive driving*/
		return (false);

	PrOpen ();
	if (!shellcheckprinterror (true))
		return (false);

	fl = false; /*until sucessfull print, this is return value*/

	if (fldialog) {
		if (!PrJobDialog (hp))
			goto exit;
	}
	else
		PrValidate (hp);

	setcursortype (cursoriswatch);

	shellupdateallnow (); /*update all windows that were dirtied by the print dialog*/

	shellpushglobals (w);

	(*shellglobals.settextmoderoutine) (false); /*make sure editing changes are accepted*/

	pushport (nil); /*save current port on stack*/

	shellprintinfo.printport = printport = PrOpenDoc (hp, nil, nil);
	currentprintport = w;

	/*prepares for printing*/
	(*shellglobals.beginprintroutine) ();

	/*fills in fields of printinfo record*/
	(*shellglobals.setprintinfoproutine) ();
	//this only counts the number of pages.

	// wird in classic lastPage gesetzt?
	if(lastPage > shellprintinfo.ctpages)
		lastPage = shellprintinfo.ctpages;

	for (i = 1; i <= lastPage; i++) { /*print one page*/

		if (PrError () != noErr)
			break;

		PrOpenPage (printport, nil);

		if (PrError () == noErr) {

			SetFractEnable (true);

			fl = (*shellglobals.printroutine) (i);

			SetFractEnable (false);
		}

		PrClosePage (printport);

		if (!fl)
			break;

		if (keyboardescape ()) {

			PrSetError (iPrAbort);

		}
	} /*for*/

	PrCloseDoc (printport);

	if (fl) {

		if (	(PrError () == noErr)
			&& ((**hp).prJob.bJDocLoop == bSpoolLoop))
		{
			PrPicFile (hp, nil, nil, nil, &printstatus);
		}

		fl = shellcheckprinterror (false);
	}

	popport ();
	
	(*shellglobals.endprintroutine) ();

	shellpopglobals ();

exit:

	PrClose ();

	currentprintport = NULL;

	return (fl);

	} /*shellprint*/