亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲精品中文字幕在线观看| 中文字幕亚洲综合久久菠萝蜜| 激情成人午夜视频| 国产日本亚洲高清| 欧美亚日韩国产aⅴ精品中极品| 免费久久99精品国产| 久久精品欧美一区二区三区不卡| 不卡的电影网站| 日韩主播视频在线| 中文字幕免费不卡在线| 日韩亚洲欧美综合| 99久久99久久免费精品蜜臀| 麻豆视频一区二区| 欧美日韩国产另类不卡| fc2成人免费人成在线观看播放| 成人小视频免费观看| 亚洲精品中文在线| 精品少妇一区二区三区在线播放| 91亚洲国产成人精品一区二区三 | 日韩国产欧美在线播放| 欧美国产丝袜视频| 精品国产麻豆免费人成网站| 91亚洲精品一区二区乱码| 精品中文字幕一区二区小辣椒| 亚洲人成在线播放网站岛国| 日本一区二区三区在线不卡| 91麻豆精品国产91久久久久久 | 久久久亚洲精品一区二区三区| 欧美午夜不卡视频| 成人h版在线观看| 久久国产综合精品| 视频一区视频二区中文字幕| 亚洲日本va午夜在线影院| 日韩精品在线网站| 欧美精品v日韩精品v韩国精品v| 色菇凉天天综合网| 国产成人av电影在线观看| 日韩av不卡一区二区| 日韩美女啊v在线免费观看| 国产日韩欧美不卡在线| 日韩免费观看2025年上映的电影| 色婷婷激情久久| 国产馆精品极品| 国产aⅴ综合色| 欧美精品一区男女天堂| 色狠狠桃花综合| 成人免费av资源| 久久99国产精品久久99| 三级欧美韩日大片在线看| 亚洲综合视频在线| 日韩理论片中文av| 国产精品国产自产拍在线| 中文字幕国产一区| 久久久99久久| 久久久久国产成人精品亚洲午夜| 2024国产精品视频| 精品国产免费视频| 久久综合国产精品| 亚洲精品一线二线三线无人区| 久久综合色播五月| 国产亚洲综合性久久久影院| 26uuu精品一区二区在线观看| 欧美日韩国产首页在线观看| 欧美一区中文字幕| 7777精品久久久大香线蕉| 欧美精品精品一区| 欧美日韩一区二区三区四区| 欧美午夜一区二区三区免费大片| 在线视频一区二区三区| 欧美午夜电影在线播放| 日韩一级大片在线观看| 日韩三级视频中文字幕| 精品对白一区国产伦| 日韩一区二区影院| 国产亚洲一区二区在线观看| 亚洲国产精华液网站w| 亚洲视频在线观看一区| 亚洲免费在线看| 亚洲国产精品精华液网站| 午夜激情久久久| 麻豆精品在线看| 成人av手机在线观看| 色94色欧美sute亚洲线路一ni| 欧美日韩一区二区三区高清| 91精品国产一区二区三区蜜臀 | 国产成人小视频| 97久久精品人人做人人爽50路| 91影视在线播放| 日韩一级片在线播放| 久久久久久久久久看片| 亚洲日本电影在线| 亚洲成国产人片在线观看| 激情综合网天天干| 99久久精品国产导航| 欧美日韩国产免费一区二区 | 欧美日韩精品福利| 在线播放欧美女士性生活| 国产女人水真多18毛片18精品视频| 自拍视频在线观看一区二区| 亚洲午夜久久久久久久久电影网| 蜜桃一区二区三区在线观看| 91小视频在线观看| 日韩一卡二卡三卡| 国产精品家庭影院| 日韩二区三区四区| 波多野洁衣一区| 在线播放欧美女士性生活| 国产精品毛片久久久久久| 视频一区在线视频| 粉嫩蜜臀av国产精品网站| 欧美日韩精品一区二区三区四区 | 一区二区三区国产精华| 免费在线看成人av| 色呦呦国产精品| 日韩亚洲欧美在线| 亚洲精品免费电影| 国产福利不卡视频| 欧美日韩精品免费| 亚洲综合免费观看高清完整版在线 | 欧美色精品在线视频| 中文字幕成人在线观看| 国产精品996| 欧美成人精品高清在线播放| 一区二区三区精品视频| 精品系列免费在线观看| 欧美色国产精品| 国产精品高潮呻吟| 粉嫩高潮美女一区二区三区| 久久夜色精品一区| 韩国三级在线一区| 久久久久久99久久久精品网站| 久久成人免费电影| 欧美v日韩v国产v| 极品美女销魂一区二区三区 | 美女视频黄频大全不卡视频在线播放| 欧洲亚洲精品在线| 亚洲福利一二三区| 欧美日韩国产一级片| 婷婷久久综合九色综合伊人色| 欧美色网一区二区| 午夜精品久久久久久久99樱桃| 欧美探花视频资源| 视频在线观看91| 日韩一区二区三区视频在线观看| 免费亚洲电影在线| wwwwww.欧美系列| 成人精品小蝌蚪| 亚洲欧美日韩在线| 欧美色电影在线| 日韩精品1区2区3区| 欧美大胆一级视频| 狠狠狠色丁香婷婷综合激情| 久久久影视传媒| 国产成都精品91一区二区三| 中文字幕中文字幕在线一区| 色婷婷综合激情| 亚洲地区一二三色| 日韩精品影音先锋| 国产黄色成人av| 亚洲柠檬福利资源导航| 欧美色区777第一页| 卡一卡二国产精品 | 成人自拍视频在线观看| 亚洲图片自拍偷拍| 欧美日韩视频在线观看一区二区三区 | 久久国产精品第一页| 亚洲精品在线网站| www.亚洲免费av| 亚洲一区二区av在线| 日韩欧美亚洲另类制服综合在线| 国产一区二区三区日韩| 1区2区3区国产精品| 欧美体内she精视频| 激情综合网av| 亚洲人成网站色在线观看| 欧美精品久久99| 国产98色在线|日韩| 亚洲已满18点击进入久久| 日韩视频一区二区在线观看| 国产aⅴ精品一区二区三区色成熟| 亚洲欧美日韩国产综合| 日韩欧美中文一区二区| 成人爱爱电影网址| 亚州成人在线电影| 欧美国产激情一区二区三区蜜月| 在线视频亚洲一区| 国产麻豆视频精品| 一区二区国产视频| 国产夜色精品一区二区av| 在线精品视频免费播放| 国产一区二区不卡| 亚洲在线免费播放| 国产午夜精品一区二区三区视频| 欧洲激情一区二区| 国产精一区二区三区| 亚洲不卡在线观看| 国产精品成人免费在线| 日韩欧美一二区| 欧美午夜电影在线播放| 国产高清久久久久|