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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? genfunc.c

?? mini gui 1.6.8 lib and source
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*** $Id: genfunc.c,v 1.13 2004/12/30 07:39:11 snig 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) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频一区二区| 99免费精品在线观看| 亚洲欧美日韩电影| 国产剧情一区二区| 蜜臀久久99精品久久久久久9| 亚洲精品少妇30p| 老司机一区二区| 国产欧美一区二区精品忘忧草| 一本一本大道香蕉久在线精品| 久久综合九色综合欧美98| 欧美性感一区二区三区| 本田岬高潮一区二区三区| 国产精品一区二区91| 精品在线播放免费| 激情六月婷婷久久| 久久精品国产亚洲高清剧情介绍| 日韩欧美精品在线| 欧美一级xxx| 色综合一个色综合| 成人在线视频一区| 久久99久久99精品免视看婷婷 | 久久久午夜精品| 777午夜精品免费视频| 欧美亚洲高清一区| 麻豆91精品视频| 狠狠色丁香婷婷综合| 日韩精品久久久久久| 五月婷婷久久丁香| 日韩成人一级片| 天天综合色天天| 日韩欧美在线123| 日韩西西人体444www| 欧美一区二区三区爱爱| 欧美日韩二区三区| 在线电影一区二区三区| 欧美电视剧免费全集观看| 国产精品69久久久久水密桃| 国产成人欧美日韩在线电影| 日本不卡免费在线视频| 奇米四色…亚洲| 色婷婷av一区二区| 色呦呦国产精品| 成人av在线影院| 99视频精品在线| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩av在线播放中文字幕| 午夜在线电影亚洲一区| 亚洲综合男人的天堂| 日韩高清在线不卡| 国产美女主播视频一区| 国产成人精品综合在线观看 | 亚洲国产wwwccc36天堂| 亚洲与欧洲av电影| 久久综合综合久久综合| 国产成人免费视| 在线观看一区二区视频| 欧美综合亚洲图片综合区| 777a∨成人精品桃花网| 91麻豆.com| 欧美一区永久视频免费观看| 久久久三级国产网站| 国产午夜一区二区三区| 久久精品视频在线免费观看| 亚洲免费在线看| 蜜桃久久久久久| 成人美女在线视频| 欧美日韩国产一级二级| 国产精品欧美一区喷水| 亚洲图片欧美一区| 国产精品自拍三区| 91九色02白丝porn| 日韩一区二区三区四区五区六区| 欧美日韩一卡二卡三卡| 成人性生交大片免费看中文| 欧美三级在线看| 欧美极品美女视频| 久久99久久精品| 免费观看成人av| 欧美日韩一卡二卡| 日本一区二区不卡视频| 免费看欧美美女黄的网站| av电影一区二区| 国产欧美一区二区精品性色超碰| 久久先锋资源网| 视频一区二区不卡| av成人老司机| 国产三级精品视频| 婷婷久久综合九色综合绿巨人| 亚洲人成小说网站色在线| 国产精品69久久久久水密桃| 5566中文字幕一区二区电影| 亚洲免费毛片网站| 国产乱子轮精品视频| 欧美成人精品福利| 亚洲一区二区精品视频| 色8久久精品久久久久久蜜| 欧美激情一区在线| 成人综合在线观看| 成人av动漫网站| 亚洲国产高清不卡| 久久国产麻豆精品| 精品国产网站在线观看| 日韩黄色小视频| 9191成人精品久久| 天涯成人国产亚洲精品一区av| 欧美性色综合网| 国产精品进线69影院| 捆绑变态av一区二区三区| 欧美电影在线免费观看| 亚洲一级二级三级| 欧美日韩国产另类一区| 亚洲精品视频在线观看网站| 色中色一区二区| 中文字幕在线观看一区二区| 91丨porny丨国产| 国产午夜精品一区二区三区视频 | 亚洲午夜激情网站| 欧美色综合天天久久综合精品| 日韩一区二区三区视频在线| 欧美日韩一区 二区 三区 久久精品| 久久精品视频网| 精品午夜久久福利影院| 久久精品亚洲乱码伦伦中文| 加勒比av一区二区| 国产精品欧美经典| www.综合网.com| 亚洲欧美区自拍先锋| 91丨porny丨蝌蚪视频| 亚洲国产wwwccc36天堂| 欧美顶级少妇做爰| 国产在线乱码一区二区三区| 久久日韩粉嫩一区二区三区| 成人免费观看av| 亚洲精品五月天| 欧美一级日韩不卡播放免费| 蜜臀久久久99精品久久久久久| 在线视频中文字幕一区二区| 亚洲国产精品久久不卡毛片| 91精品婷婷国产综合久久竹菊| 日本一二三不卡| 欧美天堂一区二区三区| 视频在线观看91| 欧美日韩国产另类一区| 美女一区二区三区在线观看| 91精品一区二区三区久久久久久| 欧美一区二区三级| 国产精品自拍三区| 亚洲国产日韩综合久久精品| 日韩三级在线观看| 成人免费电影视频| 亚洲一区二区偷拍精品| 26uuu欧美| www.在线欧美| 加勒比av一区二区| 综合久久久久久| 日韩欧美激情四射| 成人综合婷婷国产精品久久蜜臀| 中文在线免费一区三区高中清不卡| 美日韩黄色大片| 欧美精品一二三区| 不卡av电影在线播放| 亚洲国产中文字幕| 中文字幕av免费专区久久| 欧美日韩综合不卡| 成人手机在线视频| 五月天婷婷综合| 亚洲同性同志一二三专区| 717成人午夜免费福利电影| zzijzzij亚洲日本少妇熟睡| 亚洲欧美激情一区二区| 日韩欧美国产综合| 欧美日韩精品一区二区天天拍小说| 7777精品伊人久久久大香线蕉经典版下载 | 日韩中文字幕91| 蜜臀久久99精品久久久久久9 | 日本欧美肥老太交大片| 精品国产区一区| 欧美特级限制片免费在线观看| 国产精品免费av| 欧美美女喷水视频| 美女在线一区二区| 五月天视频一区| 国产三级精品三级| 3atv一区二区三区| 成人免费视频免费观看| 国产九色sp调教91| 欧美成人免费网站| 欧美午夜宅男影院| 日本高清成人免费播放| 国产精一区二区三区| 久久机这里只有精品| 亚洲一区二区三区四区五区中文| 91精品福利在线一区二区三区| 久久精品72免费观看| 最近日韩中文字幕| 国产精品色一区二区三区| 欧美午夜视频网站| 欧美在线你懂的| 国产一区二区毛片| 狠狠色狠狠色合久久伊人|