| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | #include "main_inc.h"
 | 
					
						
							|  |  |  |  | #include "mywin_snake.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | //<2F><><EFBFBD>洰<EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>appɾ<70><C9BE>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | static WIN_SnakeStruct *g_win_snake=0; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | WIN_SnakeStruct *WIN_CreatSnake (WIN_WindowStruct *base, | 
					
						
							|  |  |  |  | 			void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg), | 
					
						
							|  |  |  |  | 			int x,int y,int x_size,int y_size) | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 	//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣѭ<CFA2><D1AD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 	if (msgLoop==0) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		msgLoop=(void (*)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg))SNAKE_defaultMsgLoop;   | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	WIN_SnakeStruct *ret=mymalloc (sizeof ( WIN_SnakeStruct)); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 	//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9>캯<EFBFBD><ECBAAF>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 	if (ret) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		mymemset (ret,0,sizeof ( WIN_SnakeStruct)); | 
					
						
							|  |  |  |  | //		if (0==WIN_CreatWindowExt((WIN_WindowStruct *)ret,base,msgLoop,x,y,x_size,y_size))
 | 
					
						
							|  |  |  |  | 		if (0==WIN_CreatTouchEx((WIN_TouchWinStruct *)ret,base,msgLoop,x,y,x_size,y_size)) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			//<2F><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 			myfree (ret); | 
					
						
							|  |  |  |  | 			ret=0; | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		else | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			((WIN_WindowStruct *)ret)->winType="WIN_SnakeStruct"; | 
					
						
							|  |  |  |  | 			((WIN_WindowStruct *)ret)->intercept=1;  | 
					
						
							|  |  |  |  | 			((WIN_WindowStruct *)ret)->deleteWindow=(void (*)(struct _WIN_WindowStruct *win))SNAKE_DeleteSnake; | 
					
						
							|  |  |  |  | 			 | 
					
						
							|  |  |  |  | 			ret->delay_ms=400; | 
					
						
							|  |  |  |  | 			ret->timerId=WIN_CreatTimer ((WIN_WindowStruct *)ret,ret->delay_ms); | 
					
						
							|  |  |  |  | 			ret->snake=snake_creat(); | 
					
						
							|  |  |  |  | 			 | 
					
						
							|  |  |  |  | 			global_run_start(); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	g_win_snake=ret; | 
					
						
							|  |  |  |  | 	return ret; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | void SNAKE_DeleteSnake (WIN_SnakeStruct *s ) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	CALL_BACK_ENTER(); | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	snake_delete(s->snake); | 
					
						
							|  |  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 	//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٺ<EFBFBD><D9BA><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 	WIN_DeleteWindow ( (WIN_WindowStruct *)s); | 
					
						
							|  |  |  |  | 	g_win_snake=0; | 
					
						
							|  |  |  |  | 	global_run_exit(); | 
					
						
							|  |  |  |  | 	CALL_BACK_EXIT(); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | int __app_exit(void *ptr) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	CALL_BACK_ENTER(); | 
					
						
							|  |  |  |  | 	if(g_win_snake) SNAKE_DeleteSnake(g_win_snake); | 
					
						
							|  |  |  |  | 	CALL_BACK_EXIT(); | 
					
						
							|  |  |  |  | 	return 0; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | //<2F><>Ϣ<EFBFBD><CFA2><EFBFBD>Ļ<EFBFBD><C4BB>ƺ<EFBFBD><C6BA><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | void SNAKE_DefaultPaint (WIN_SnakeStruct *s) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	int x=0; | 
					
						
							|  |  |  |  | 	int y=0; | 
					
						
							|  |  |  |  | 	int x_size=((WIN_WindowStruct *)s)->x_size; | 
					
						
							|  |  |  |  | 	int y_size=((WIN_WindowStruct *)s)->y_size; | 
					
						
							|  |  |  |  | 	u32 color=((WIN_WindowStruct *)s)->color; | 
					
						
							|  |  |  |  | 	u32 bkcolor=((WIN_WindowStruct *)s)->bkcolor; | 
					
						
							|  |  |  |  | 	char txt_buff[20]={0}; | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	WIN_PaintBackGround ((WIN_WindowStruct *)s); | 
					
						
							|  |  |  |  | 	u32 font_type=WIN_SetFontType(24); | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	WIN_SetLcdColor(color); | 
					
						
							|  |  |  |  | 	WIN_SetLcdBkColor(bkcolor); | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	if(s->snake) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		int s_x=30; | 
					
						
							|  |  |  |  | 		int s_y=25; | 
					
						
							|  |  |  |  | 		WIN_SetLcdColor(bkcolor); | 
					
						
							|  |  |  |  | 		WIN_FillRectByColor(s_x-1,s_y-1,200+2,200+2); | 
					
						
							|  |  |  |  | 		WIN_SetLcdColor(color); | 
					
						
							|  |  |  |  | 		WIN_DrawRect(s_x-1,s_y-1,200+2,200+2); | 
					
						
							|  |  |  |  | 		cell_struct *cell=0; | 
					
						
							|  |  |  |  | 		for(int y=0;y<MAP_Y_SIZE;y++) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			for(int x=0;x<MAP_X_SIZE;x++) | 
					
						
							|  |  |  |  | 			{ | 
					
						
							|  |  |  |  | 				cell=&s->snake->map[y*MAP_X_SIZE+x]; | 
					
						
							|  |  |  |  | 				if(cell->type==CELL_TYPE_WALL) | 
					
						
							|  |  |  |  | 				{ | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					//ǽ<><C7BD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					WIN_DrawRect(s_x+x*8,s_y+y*8,8,8); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				else if(cell->type==CELL_TYPE_HEAD) | 
					
						
							|  |  |  |  | 				{ | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					//ͷ<><CDB7>Сһ<D0A1><D2BB><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					WIN_DrawRect(s_x+x*8+2,s_y+y*8+2,8-4,8-4); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				else if(cell->type==CELL_TYPE_BODY) | 
					
						
							|  |  |  |  | 				{ | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					//<2F><><EFBFBD>壬ȫ<E5A3AC>ڷ<EFBFBD><DAB7><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					WIN_FillRectByColor(s_x+x*8,s_y+y*8,8,8); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				else if(cell->type==CELL_TYPE_FOOD) | 
					
						
							|  |  |  |  | 				{ | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					//ʳ<>ʮ<EFA3AC>ּ<EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					WIN_DrawHLine(s_x+x*8,s_y+y*8+2,s_x+x*8+8-1); | 
					
						
							|  |  |  |  | 					WIN_DrawHLine(s_x+x*8,s_y+y*8+5,s_x+x*8+8-1); | 
					
						
							|  |  |  |  | 					WIN_DrawVLine(s_x+x*8+2,s_y+y*8,s_y+y*8+8-1); | 
					
						
							|  |  |  |  | 					WIN_DrawVLine(s_x+x*8+5,s_y+y*8,s_y+y*8+8-1); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 		sprintf(txt_buff,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d",s->snake->mark); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 		WIN_DrawTxtAt(txt_buff,276,30); | 
					
						
							|  |  |  |  | 		if(s->suspend) | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			WIN_DrawTxtAt("<EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD>",276,60); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 	} | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	 | 
					
						
							|  |  |  |  | 	WIN_SetFontType(font_type); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | //<2F><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | void SNAKE_defaultMsgLoop (WIN_SnakeStruct *s,WIN_MsgStruct *msg) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	CALL_BACK_ENTER(); | 
					
						
							|  |  |  |  | 	WIN_KeyStruct *k=0; | 
					
						
							|  |  |  |  | 	WIN_MoveStruct *m=0; | 
					
						
							|  |  |  |  | 	switch (msg->msg) | 
					
						
							|  |  |  |  | 	{	 | 
					
						
							|  |  |  |  | 		case WIN_MSG_PAINT: | 
					
						
							|  |  |  |  | 			SNAKE_DefaultPaint(s); | 
					
						
							|  |  |  |  | 		break; | 
					
						
							|  |  |  |  | 		case WIN_MSG_INIT: | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			s->but_up=WIN_CreatButton((WIN_WindowStruct *)s,0,350,110,30,30); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			BUTTON_SetKeyString(s->but_up,"<EFBFBD><EFBFBD>"); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 			s->but_down=WIN_CreatButton((WIN_WindowStruct *)s,0,350,200,30,30); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			BUTTON_SetKeyString(s->but_down,"<EFBFBD><EFBFBD>"); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 			s->but_left=WIN_CreatButton((WIN_WindowStruct *)s,0,300,160,30,30); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			BUTTON_SetKeyString(s->but_left,"<EFBFBD><EFBFBD>"); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 			s->but_right=WIN_CreatButton((WIN_WindowStruct *)s,0,400,160,30,30); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 			BUTTON_SetKeyString(s->but_right,"<EFBFBD><EFBFBD>"); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 		} | 
					
						
							|  |  |  |  | 		break; | 
					
						
							|  |  |  |  | 		case WIN_MSG_TIMER: | 
					
						
							|  |  |  |  | 		if (msg->data.v==s->timerId) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			if(s->suspend==0) | 
					
						
							|  |  |  |  | 			{ | 
					
						
							|  |  |  |  | 				if(snake_run(s->snake)==0) | 
					
						
							|  |  |  |  | 				{ | 
					
						
							|  |  |  |  | 					WIN_DeleteTimer(s->timerId); | 
					
						
							|  |  |  |  | 					char *txt=mymalloc(128); | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					sprintf(txt,"<EFBFBD><EFBFBD>Ϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%d",s->snake->mark); | 
					
						
							|  |  |  |  | 					MSGBOX_Tips((WIN_WindowStruct *)s,"<EFBFBD><EFBFBD>ʾ",txt,"ȷ<EFBFBD><EFBFBD>"); | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					myfree(txt); | 
					
						
							|  |  |  |  | 					s->delay_ms=400; | 
					
						
							|  |  |  |  | 					snake_init(s->snake); | 
					
						
							|  |  |  |  | 					s->timerId=WIN_CreatTimer ((WIN_WindowStruct *)s,s->delay_ms); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				if(s->delay_ms>100)  | 
					
						
							|  |  |  |  | 				{ | 
					
						
							|  |  |  |  | 					s->delay_ms=400-s->snake->mark*3; | 
					
						
							|  |  |  |  | 					WIN_SetTimerCycle(s->timerId,s->delay_ms); | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				WIN_SetInvalidWhenTop ((WIN_WindowStruct *)s); | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		break; | 
					
						
							|  |  |  |  | 		case WIN_MSG_KEY: | 
					
						
							|  |  |  |  | 			k=msg->data.p; | 
					
						
							|  |  |  |  | 			break;//case WIN_MSG_KEY:
 | 
					
						
							|  |  |  |  | 		case WIN_MSG_MOVE: | 
					
						
							|  |  |  |  | 			m=msg->data.p; | 
					
						
							|  |  |  |  | 			switch (m->moveType) | 
					
						
							|  |  |  |  | 			{ | 
					
						
							|  |  |  |  | 				case MOVE_DATA_SHORT: | 
					
						
							| 
									
										
										
										
											2025-07-05 19:47:28 +08:00
										 |  |  |  | 					s->suspend=!s->suspend;		//<2F><>ͣ
 | 
					
						
							| 
									
										
										
										
											2025-06-27 00:32:57 +08:00
										 |  |  |  | 					WIN_SetInvalidWhenTop ((WIN_WindowStruct *)s); | 
					
						
							|  |  |  |  | 					break; | 
					
						
							|  |  |  |  | 				default: | 
					
						
							|  |  |  |  | 					break; | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 			break; | 
					
						
							|  |  |  |  | 		case WIN_MSG_CHID: | 
					
						
							|  |  |  |  | 			switch (msg->data.v) | 
					
						
							|  |  |  |  | 			{ | 
					
						
							|  |  |  |  | 				case CHID_DELETE: | 
					
						
							|  |  |  |  | 				break; | 
					
						
							|  |  |  |  | 				case CHID_USER: | 
					
						
							|  |  |  |  | 				{ | 
					
						
							|  |  |  |  | 					if (msg->data2.v==BUTTON_PRESSED) | 
					
						
							|  |  |  |  | 					{ | 
					
						
							|  |  |  |  | 						if (msg->srcWin==s->but_up) | 
					
						
							|  |  |  |  | 						{ | 
					
						
							|  |  |  |  | 							snake_set_dir(s->snake,DIR_UP); | 
					
						
							|  |  |  |  | 						} | 
					
						
							|  |  |  |  | 						else if (msg->srcWin==s->but_down) | 
					
						
							|  |  |  |  | 						{ | 
					
						
							|  |  |  |  | 							snake_set_dir(s->snake,DIR_DOWN); | 
					
						
							|  |  |  |  | 						} | 
					
						
							|  |  |  |  | 						else if (msg->srcWin==s->but_left) | 
					
						
							|  |  |  |  | 						{ | 
					
						
							|  |  |  |  | 							snake_set_dir(s->snake,DIR_LEFT); | 
					
						
							|  |  |  |  | 						} | 
					
						
							|  |  |  |  | 						else if (msg->srcWin==s->but_right) | 
					
						
							|  |  |  |  | 						{ | 
					
						
							|  |  |  |  | 							snake_set_dir(s->snake,DIR_RIGHT); | 
					
						
							|  |  |  |  | 						} | 
					
						
							|  |  |  |  | 						WIN_SetInvalid ((WIN_WindowStruct *)s); | 
					
						
							|  |  |  |  | 					} | 
					
						
							|  |  |  |  | 				} | 
					
						
							|  |  |  |  | 				break; | 
					
						
							|  |  |  |  | 				default: | 
					
						
							|  |  |  |  | 				break; | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 			break; | 
					
						
							|  |  |  |  | 		default: | 
					
						
							|  |  |  |  | 			WIN_DefaultMsgLoop((WIN_WindowStruct *)s,msg); | 
					
						
							|  |  |  |  | 		break; | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	CALL_BACK_EXIT(); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | WIN_SnakeStruct *SNAKE_StartGame (WIN_WindowStruct *base) | 
					
						
							|  |  |  |  | {  | 
					
						
							|  |  |  |  | 	WIN_SnakeStruct *ret=0; | 
					
						
							|  |  |  |  | 	if (base) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		ret=WIN_CreatSnake (base,0,0,0,base->x_size,base->y_size); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	else | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		ret=WIN_CreatSnake (0,0,0,0,WIN_GetBaseWindow()->x_size,WIN_GetBaseWindow()->y_size); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	WIN_SetBackPic ((WIN_WindowStruct *)ret); | 
					
						
							|  |  |  |  | 	WIN_ShowWindow((WIN_WindowStruct*)ret); | 
					
						
							|  |  |  |  | 	return ret; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 |