亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? genfunc.c

?? 該源碼是miniGUI的全部代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: genfunc.c,v 1.9 2003/09/04 02:57:09 weiym Exp $**** genfunc.c: Native Low Level Graphics Engine 's commone file**** Copyright (C) 2003 Feynman Software** Copyright (C) 2000 Song Lixin**** Create by Song Lixin, 2000/10/18*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <stdio.h>#include <stdlib.h>#include <string.h>#include "common.h"#include "minigui.h"#include "gal.h"#include "native.h"//==================================================================================================//general functions//static void drawrow(PSD psd, int x1, int x2, int y);static void drawcol(PSD psd, int x,int y1,int y2);static inline void setpixel(PSD psd, int x, int y, int c);static void setcirclepixels(PSD psd, int x, int y, int sx, int sy, int c);static void setcirclepixels(PSD psd, int x, int y, int sx, int sy, int c);static inline int muldiv64(int m1, int m2, int d);/* initialize memory device with passed parms*/void native_gen_initmemgc(PSD mempsd,int w,int h,int planes,int bpp,int linelen, int size,void *addr) {	mempsd->xres = w;	mempsd->yres = h;	mempsd->xvirtres = w;	mempsd->yvirtres = h;	mempsd->planes = planes;	mempsd->bpp = bpp;	mempsd->linelen = linelen;	mempsd->size = size;	mempsd->addr = addr;}/* allocate a memory screen device*/PSD native_gen_allocatememgc(PSD psd){	PSD	mempsd;	mempsd = malloc(sizeof(SCREENDEVICE));	if (!mempsd)		return NULL;	/* copy passed device get initial values*/	*mempsd = *psd;	/* initialize*/	mempsd->flags |= PSF_MEMORY;	mempsd->flags &= ~PSF_SCREEN;	mempsd->addr = NULL;	return mempsd;}void native_gen_freememgc(PSD mempsd){	/* note: mempsd->addr must be freed elsewhere*/	free(mempsd);}void native_gen_fillrect(PSD psd,int x, int y, int w, int h, gal_pixel c){#if 1	while (h--)		psd->DrawHLine(psd, x, y++, w, c);#else	while (w--)		psd->DrawVLine(psd, x++, y , h, c);#endif}int native_gen_clippoint(PSD psd, int x ,int y){	if(psd->doclip) {		if ((x >= psd->clipminx) && (x < psd->clipmaxx) &&			(y >= psd->clipminy) && (y < psd->clipmaxy)) 			return CLIP_VISIBLE;	} else {		if ((x >= 0) && (x < psd->xres) && (y >= 0) && (y < psd->yres)) 			return CLIP_VISIBLE;	}	return CLIP_INVISIBLE;}int native_gen_cliphline(PSD psd,int * px,int * py, int * pw){	if (psd->doclip) {		if ( (*px >= psd->clipmaxx) || (*py >= psd->clipmaxy) || 		     (*px + *pw - 1 < psd->clipminx) || (*py < psd->clipminy) )				return CLIP_INVISIBLE;		if ( (*px >= psd->clipminx) && (*py >= psd->clipminy) && 		     (*px + *pw -1 < psd->clipmaxx) && (*py < psd->clipmaxy) )				return CLIP_VISIBLE;					if (*px < psd->clipminx) {			*pw -= psd->clipminx - *px;			*px = psd->clipminx;		}		if (*px + *pw - 1 >= psd->clipmaxx)				*pw = psd->clipmaxx - *px;	} else {		if ( (*px >= psd->xres) || (*py >= psd->yres) || (*px + *pw - 1 < 0) || (*py < 0) )				return CLIP_INVISIBLE;		if ( (*px >= 0) && (*py >= 0) && (*px + *pw -1 < psd->xres) && (*py < psd->yres) )				return CLIP_VISIBLE;					if (*px < 0) {			*pw += *px;				*px = 0;		}		if (*px + *pw - 1 >= psd->xres)				*pw = psd->xres - *px;	}    if (*pw <= 0)        return CLIP_INVISIBLE;	return CLIP_PARTIAL;		}int native_gen_clipvline(PSD psd,int * px,int * py, int *ph){	if (psd->doclip) {		if ( (*px >= psd->clipmaxx) || (*py >= psd->clipmaxy) || 		     (*px < psd->clipminx) || (*py + *ph - 1 < psd->clipminy) )				return CLIP_INVISIBLE;		if ( (*px >= psd->clipminx) && (*py >= psd->clipminy) && 		     (*px < psd->clipmaxx) && (*py + *ph - 1 < psd->clipmaxy) )				return CLIP_VISIBLE;					if (*py < psd->clipminy) {			*ph -= psd->clipminy - *py;			*py = psd->clipminy;		}		if (*py + *ph - 1 >= psd->clipmaxy)				*ph = psd->clipmaxy - *py;	} else {		if ( (*py >= psd->yres) || (*px >= psd->xres) || (*py + *ph - 1 < 0) || (*px < 0) )				return CLIP_INVISIBLE;		if ( (*py >= 0) && (*px >= 0) && (*py + *ph -1 < psd->yres) && (*px < psd->xres) )				return CLIP_VISIBLE;					if (*py < 0) {			*ph += *py;				*py = 0;		}		if (*py + *ph - 1 >= psd->yres)				*ph = psd->yres - *py;	}    if (*ph <= 0)        return CLIP_INVISIBLE;	return CLIP_PARTIAL;		}int native_gen_clipline (PSD psd,int * px1,int * py1, int * px2,int *py2){	int w,h;	int r1;	int clip_first;	int clip_last;	if(*px1 == *px2) {		if (*py1 == *py2)			return native_gen_clippoint (psd,*px1,*px2);		if (*py1 > *py2) {			h = *py1 - *py2 + 1;			r1 = native_gen_clipvline (psd, px1, py2, &h);			if (r1 == CLIP_PARTIAL)					*py1 = *py2 + h - 1;				return r1;		} else {			h = *py2 - *py1 + 1;			r1 = native_gen_clipvline (psd, px1, py1, &h);			if (r1 == CLIP_PARTIAL)					*py2 = *py1 + h - 1;				return r1;		}		}		if(*py1 == *py2) {		if (*px1 > *px2) {			w = *px1 - *px2 + 1;			r1 = native_gen_clipvline (psd, px2, py1, &w);			if (r1 == CLIP_PARTIAL)					*px1 = *px2 + w - 1;				return r1;		} else {			w = *px2 - *px1 + 1;			r1 = native_gen_clipvline (psd, px2, py2, &w);			if (r1 == CLIP_PARTIAL)					*px2 = *px1 + w - 1;				return r1;		}		}		return cs_clipline(psd,px1,py1,px2,py2,&clip_first,&clip_last);	}/* *	You should give a normalized rect. that is 					*pw > 0					*ph > 0  *  * 	returned value: *	CLIP_VISIBLE		The whole rectangle is visible *	CLIP_INVISIBLE		The whole rectangle is invisible *	CLIP_PARTIAL		The rectangle may be partially visible * 	 *      if returned CLIP_PARTIAL,the parameter is modified to hold the part *	that is in the clip region. */int native_gen_clipbox (PSD psd,int * px,int * py, int * pw,int *ph){	if (*pw == 1) 		return native_gen_clipvline(psd, px, py, ph);			if (*ph == 1)		return native_gen_cliphline(psd, px, py, pw);		if (psd->doclip) {		if ( (*px >= psd->clipmaxx) || (*py >= psd->clipmaxy) || 		     (*px + *pw - 1 < psd->clipminx) || (*py + *ph - 1 < psd->clipminy) )				return CLIP_INVISIBLE;		if ( (*px >= psd->clipminx) && (*py >= psd->clipminy) && 		     (*px + *pw -1 < psd->clipmaxx) && (*py + *ph - 1 < psd->clipmaxy) )				return CLIP_VISIBLE;					if (*px < psd->clipminx) {			*pw -= psd->clipminx - *px;			*px = psd->clipminx;		}		if (*py < psd->clipminy) {			*ph -= psd->clipminy - *py;			*py = psd->clipminy;		}		if (*px + *pw - 1 >= psd->clipmaxx)				*pw = psd->clipmaxx - *px;		if (*py + *ph - 1 >= psd->clipmaxy)				*ph = psd->clipmaxy - *py;	} else {		if ( (*px >= psd->xres) || (*py >= psd->yres) || 	             (*px + *pw - 1 < 0) || (*py +*ph - 1 < 0) )				return CLIP_INVISIBLE;		if ( (*px >= 0) && (*py >= 0) && (*px + *pw -1 < psd->xres) 			&& (*py + *ph - 1 < psd->yres) )				return CLIP_VISIBLE;					if (*px < 0) {			*pw += *px;				*px = 0;		}		if (*px + *pw - 1 >= psd->xres)				*pw = psd->xres - *px;		if (*py < 0) {			*ph += *py;				*py = 0;		}		if (*py + *ph - 1 >= psd->yres)				*ph = psd->yres - *py;			}    if (*pw <= 0 || *ph <= 0)        return CLIP_INVISIBLE;	return CLIP_PARTIAL;		}//==================================================================================================// help functions/* * Calculate size and linelen of memory gc. * If bpp or planes is 0, use passed psd's bpp/planes. * Note: linelen is calculated to be DWORD aligned for speed * for bpp <= 8.  Linelen is converted to bytelen for bpp > 8. */int native_gen_calcmemgcalloc(PSD psd, unsigned int width, unsigned int height, int planes,	int bpp, int *psize, int *plinelen){	int	bytelen, linelen;	if(!planes)		planes = psd->planes;	if (!bpp)		bpp = psd->bpp;	/*	 * use bpp and planes to create size and linelen.	 * linelen is in bytes for bpp 1, 2, 4, 8, and pixels for bpp 16,24,32.	 */	if(planes == 1) {		switch(bpp) {		case 1:		case 2:		case 4:		case 8:			bytelen = linelen = (width+3) & ~3;		break;		case 16:			linelen = width;			bytelen = width * 2;		break;		case 24:			linelen = width;			bytelen = width * 3;		break;		case 32:			linelen = width;			bytelen = width * 4;		break;		default:			return 0;		}	} else if(planes == 4) {		/* FIXME assumes VGA 4 planes 4bpp*/		/* we use 4bpp linear for memdc format*/		bytelen = linelen = (width+3) & ~3;	} else {		*psize = *plinelen = 0;		return 0;	}	*plinelen = linelen;	*psize = bytelen * height;	return 1;}void native_gen_rect(PSD psd , int l, int t, int r, int b){	drawrow(psd, l, r, t);	drawrow(psd, l, r, b);	drawcol(psd, l, t, b);	drawcol(psd, r, t, b);}/* * Draw an arbitrary line using the current clipping region and foreground color * If bDrawLastPoint is FALSE, draw up to but not including point x2, y2. * * This routine is the only routine that adjusts coordinates for supporting * two different types of upper levels, those that draw the last point * in a line, and those that draw up to the last point.  All other local * routines draw the last point.  This gives this routine a bit more overhead, * but keeps overall complexity down. */void native_gen_line(PSD psd, int x1, int y1, int x2, int y2, BOOL bDrawLastPoint){  int xdelta;			/* width of rectangle around line */  int ydelta;			/* height of rectangle around line */  int xinc;			/* increment for moving x coordinate */  int yinc;			/* increment for moving y coordinate */  int rem;			/* current remainder */  int temp;  /* See if the line is horizontal or vertical. If so, then call   * special routines.   */  if (y1 == y2) {	/*	 * Adjust coordinates if not drawing last point.  Tricky.	 */	if(!bDrawLastPoint) {		if (x1 > x2) {			temp = x1;			x1 = x2 + 1;			x2 = temp;		} else			--x2;	}	/* call faster line drawing routine*/	drawrow(psd, x1, x2, y1);	return;  }  if (x1 == x2) {	/*	 * Adjust coordinates if not drawing last point.  Tricky.	 */	if(!bDrawLastPoint) {		if (y1 > y2) {			temp = y1;			y1 = y2 + 1;			y2 = temp;		} else			--y2;	}	/* call faster line drawing routine*/	drawcol(psd, x1, y1, y2);	return;  }  /* The line may be partially obscured. Do the draw line algorithm   * checking each point against the clipping regions.   */  xdelta = x2 - x1;  ydelta = y2 - y1;  if (xdelta < 0) xdelta = -xdelta;  if (ydelta < 0) ydelta = -ydelta;  xinc = (x2 > x1) ? 1 : -1;  yinc = (y2 > y1) ? 1 : -1;  if (psd->ClipPoint(psd, x1, y1))	  psd->DrawPixel(psd, x1, y1, psd->gr_foreground);  if (xdelta >= ydelta) {	rem = xdelta / 2;	for(;;) {		if(!bDrawLastPoint && x1 == x2)			break;		x1 += xinc;		rem += ydelta;		if (rem >= xdelta) {			rem -= xdelta;			y1 += yinc;		}		if (psd->ClipPoint(psd, x1, y1))			psd->DrawPixel(psd, x1, y1, psd->gr_foreground);		if(bDrawLastPoint && x1 == x2)			break;	}  } else {	rem = ydelta / 2;	for(;;) {		if(!bDrawLastPoint && y1 == y2)			break;		y1 += yinc;		rem += xdelta;		if (rem >= ydelta) {			rem -= ydelta;			x1 += xinc;		}		if (psd->ClipPoint(psd, x1, y1))			psd->DrawPixel(psd, x1, y1, psd->gr_foreground);		if(bDrawLastPoint && y1 == y2)			break;	}  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久精品国产片果冻| 狠狠色丁香婷婷综合久久片| 久久亚洲综合色| 91麻豆精品国产自产在线 | 欧美视频一区二区在线观看| 国产成人av电影在线| 国产丶欧美丶日本不卡视频| 国产成a人亚洲| eeuss鲁片一区二区三区在线看| 成人av动漫在线| 91丨九色丨尤物| 91浏览器入口在线观看| 色天天综合久久久久综合片| 欧美三级日韩在线| 日韩午夜在线观看视频| 久久综合九色综合97_久久久| 国产性色一区二区| 《视频一区视频二区| 一区二区理论电影在线观看| 亚洲国产aⅴ成人精品无吗| 午夜精品国产更新| 国产一区日韩二区欧美三区| 成人永久免费视频| 色妞www精品视频| 777亚洲妇女| 欧美激情中文字幕一区二区| 亚洲精品中文在线| 日韩高清一区在线| 国产激情一区二区三区桃花岛亚洲| 国产成人综合精品三级| 91蜜桃免费观看视频| 欧美日韩国产另类不卡| 日韩三区在线观看| 亚洲国产精品ⅴa在线观看| 亚洲一本大道在线| 国产在线播放一区| 在线观看一区二区精品视频| 精品国产乱子伦一区| 成人欧美一区二区三区黑人麻豆| 午夜精品影院在线观看| 国产另类ts人妖一区二区| 欧美在线制服丝袜| 久久奇米777| 亚洲一区二区欧美激情| 国产成人精品免费一区二区| 欧美精品乱码久久久久久| 国产精品久久久久久久久果冻传媒| 天天做天天摸天天爽国产一区| 国产精品夜夜嗨| 欧美一区二区三区日韩视频| 亚洲日本在线a| 国产麻豆欧美日韩一区| 欧美日韩卡一卡二| 国产精品欧美一区二区三区| 激情综合色丁香一区二区| 在线观看国产91| 亚洲男人的天堂一区二区| 丰满岳乱妇一区二区三区| 欧美变态tickling挠脚心| 亚洲天堂2014| 岛国一区二区在线观看| 精品久久人人做人人爽| 日韩vs国产vs欧美| 欧美视频一区在线观看| 一区二区三区久久久| 色综合激情久久| 亚洲卡通动漫在线| www.欧美精品一二区| 欧美激情综合五月色丁香 | 国产乱码精品1区2区3区| 欧美一区二区三区四区高清 | 精品久久一二三区| 日韩成人午夜精品| 69堂成人精品免费视频| 三级欧美在线一区| 欧美日高清视频| 日韩经典一区二区| 欧美一区二区女人| 蜜桃一区二区三区在线观看| 日韩欧美国产成人一区二区| 日韩国产高清影视| 欧美一区二区三区日韩| 天天亚洲美女在线视频| 欧美精品第1页| 婷婷久久综合九色综合伊人色| 欧美日韩免费视频| 日韩福利电影在线| 欧美成人高清电影在线| 国内精品国产成人国产三级粉色| 精品国产免费久久| 成人午夜视频在线观看| 亚洲欧洲99久久| 欧洲一区二区av| 日韩精品久久理论片| 日韩久久久久久| 国产精品综合二区| 亚洲三级电影网站| 欧美无砖专区一中文字| 美日韩一级片在线观看| 日本一区二区高清| 欧美中文字幕一区二区三区亚洲| 水蜜桃久久夜色精品一区的特点| 欧美成人一区二区三区| 成人性色生活片| 五月婷婷综合网| 久久影音资源网| 99re这里只有精品视频首页| 亚洲成人黄色小说| 久久久午夜精品理论片中文字幕| 成年人网站91| 爽爽淫人综合网网站| 国产精品欧美久久久久无广告| 欧洲中文字幕精品| 国产一区二区三区不卡在线观看 | 久久久亚洲高清| 色八戒一区二区三区| 美女脱光内衣内裤视频久久网站| 国产精品三级av在线播放| 欧美区在线观看| 成人一区二区视频| 日本欧美韩国一区三区| 亚洲视频电影在线| 欧美xxxxxxxxx| 欧美在线观看你懂的| 高清成人在线观看| 美女脱光内衣内裤视频久久网站 | 捆绑变态av一区二区三区| 国产女同性恋一区二区| 欧美日韩一区二区三区在线看| 高清国产一区二区| 美女视频网站久久| 一区二区三区波多野结衣在线观看| 久久亚洲综合av| 在线播放中文一区| 91九色02白丝porn| 成人黄色小视频| 国产一区二区91| 日韩成人精品在线观看| 亚洲一区中文在线| 中文字幕中文字幕一区二区| 欧美大白屁股肥臀xxxxxx| 精品视频一区二区三区免费| 成人久久久精品乱码一区二区三区| 麻豆国产精品一区二区三区| 天堂精品中文字幕在线| 亚洲一区av在线| 亚洲综合在线免费观看| 中文字幕一区在线| 日本一区免费视频| 国产色综合久久| 久久久噜噜噜久久中文字幕色伊伊| 日韩一区二区三| 日韩欧美在线观看一区二区三区| 欧美中文字幕亚洲一区二区va在线 | 欧美xxxxxxxx| 日韩精品中文字幕在线不卡尤物 | 337p粉嫩大胆噜噜噜噜噜91av| 91麻豆精品国产91久久久久| 欧美精品视频www在线观看| 欧美私人免费视频| 欧美精三区欧美精三区| 4438亚洲最大| 日韩一级视频免费观看在线| 欧美成人乱码一区二区三区| 久久久久久电影| 久久精品在这里| 国产精品白丝在线| 亚洲国产中文字幕| 奇米影视在线99精品| 国产综合色产在线精品| 国产乱码精品一区二区三区av| 东方aⅴ免费观看久久av| www.亚洲免费av| 色视频欧美一区二区三区| 精品视频一区二区不卡| 日韩欧美国产系列| 久久精品免视看| 国产精品美女久久久久高潮 | 在线观看欧美日本| 日韩亚洲欧美中文三级| 国产欧美视频一区二区| 国产精品久久久久久久久动漫| 亚洲男人的天堂在线观看| 日韩不卡一区二区三区| 激情欧美一区二区| 成年人国产精品| 日韩视频免费观看高清完整版| 久久免费看少妇高潮| 亚洲国产色一区| 成人免费视频网站在线观看| 欧美午夜在线观看| 久久久国产精品午夜一区ai换脸| 国产精品久久久久久久久动漫| 亚洲一二三级电影| 成人性生交大片免费看中文| 欧美日韩国产精选| 亚洲国产精品黑人久久久| 日韩精品免费专区| 色婷婷久久综合| 欧美成人精精品一区二区频|