⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xpol_4.h

📁 nucleus 文件系统,内核和彩色图形系统,在小系统上非常好用
💻 H
字号:
/*************************************************************************/
/*                                                                       */
/*         Copyright (c) 1997 - 1999 Accelerated Technology, Inc.        */
/*                                                                       */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
/* subject matter of this material.  All manufacturing, reproduction,    */
/* use, and sales rights pertaining to this subject matter are governed  */
/* by the license agreement.  The recipient of this software implicitly  */
/* accepts the terms of the license.                                     */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                            VERSION          */
/*                                                                       */
/*      xpol_4.h                                         1.9             */
/*                                                                       */
/* COMPONENT                                                             */
/*                                                                       */
/*      All                                                              */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains GET/AET structures & definitions.             */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      Robert G. Burrill, Accelerated Technology, Inc.                  */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*         GiacD          2/9/99     Added fixed-point math support      */
/*         BobB          11/16/99    Got rid of ANSI compiler warnings   */
/*                                                                       */
/*************************************************************************/

//#define STACK_BUFFER_SIZE 2048
#define STACK_BUFFER_SIZE 40960
/* Required elements in any GET/AET edge structure. Must come first in
structure! */
typedef struct _edge{
	struct _edge *NextEdge;	/* pointer to next edge in linked list 
							(ignored for hardwired lines) */
	short CurrentX;	/* X coord of edge (initial X at first, then current X) */
	short StartY;	/* initial Y coord of edge (at top) */
	short Count;	/* # of scan lines on which this edge is active */
	sbyte XDirection; /* amount by which to advance X when error term turns over */
	sbyte TopToBottom; /* 1 if this edge ran top to bottom as found in the vertex
					  list, -1 for bottom to top (used for winding rule) */
} edge;

/* State of one straight edge in a GET or AET, used by polygon filler.  (Suitable
only for hardwired straight edge filler, flagged by allLineEdges.)  Note that in
386 protected mode entries are still words, to make it possible to handle as many
edges as possible. */
typedef struct _lineEdge {
	struct _lineEdge *NextEdge;	/* pointer to next edge in linked list 
							(ignored for hardwired lines) */
	short CurrentX;	/* X coord of edge (initial X at first, then current X) */
	short StartY;	/* initial Y coord of edge (at top) */
	short Count;	/* # of scan lines on which this edge is active */
	sbyte XDirection; /* amount by which to advance X when error term turns over */
	sbyte TopToBottom; /* 1 if this edge ran top to bottom as found in the vertex
					  list, -1 for bottom to top (used for winding rule) */
	short WholePixelXMove;	/* minimum amount to advance X by from one scan line
							to the next */
	short ErrorTerm;		/* just what it says */
	short ErrorTermAdjUp;	/* amount to add to error term from one line to the next */
	short ErrorTermAdjDown;	/* amount to subtract from error term when it turns over */
} lineEdge;

/* State of one quadrant arc edge in GET or AET. */
typedef struct _qarcState{
	struct _qarcState *NextEdge;	/* pointer to next edge in linked list 
									(ignored for hardwired lines) */
	short CurrentX;			/* X coord of edge (initial X at first, then current X) */
	short StartY;			/* initial Y coord of edge (at top) */
	short Count;			/* # of scan lines on which this edge is active */
	sbyte XDirection;		/* amount by which to advance X when error term turns over */
	sbyte TopToBottom;		/* 1 if this edge ran top to bottom as found in the vertex
							list, -1 for bottom to top (used for winding rule) */
	byte (*StepVector)(struct _qarcState *);	/* address of routine to use to step the edge
							(ignored for hardwired lines) */
	long countNumber;		/* 0 if this is a 0-count edge, 1 if it's a 1-count edge.
							Used only for double winding rule scanning */
	long qaASq;				/* X radius squared */
	long qaBSq;				/* Y radius squared */
	long qaASqX2;			/* X radius squared times 2 */
	long qaBSqX2;			/* Y radius squared times 2 */
#ifdef FIXPOINT	
	dblFix qaXAdjust;
	dblFix qaYAdjust;
	dblFix qaErrTerm;
#else
	double qaXAdjust;
	double qaYAdjust;
	double qaErrTerm;
#endif
	long qaFinalX;
} qarcState;

/* Required elements in any vectored stepping GET/AET edge structure. Must come first
in structure! */
typedef struct _Vedge{
	struct _Vedge *NextEdge;	/* pointer to next edge in linked list 
							(ignored for hardwired lines) */
	short CurrentX;	/* X coord of edge (initial X at first, then current X) */
	short StartY;	/* initial Y coord of edge (at top) */
	short Count;	/* # of scan lines on which this edge is active */
	sbyte XDirection; /* amount by which to advance X when error term turns over */
	sbyte TopToBottom; /* 1 if this edge ran top to bottom as found in the vertex
					  list, -1 for bottom to top (used for winding rule) */
	byte (*StepVector)(struct _qarcState *);	/* address of routine to use to step the edge
							(ignored for hardwired lines) */
	long countNumber;		/* 0 if this is a 0-count edge, 1 if it's a 1-count edge.
							Used only for double winding rule scanning */
} Vedge;

/* State of one straight edge in a GET or AET, used by vectored stepping handler. */
typedef struct _lineEdgeV{
	struct _lineEdgeV *NextEdge;	/* pointer to next edge in linked list 
							(ignored for hardwired lines) */
	short CurrentX;	/* X coord of edge (initial X at first, then current X) */
	short StartY;	/* initial Y coord of edge (at top) */
	short Count;	/* # of scan lines on which this edge is active */
	sbyte XDirection; /* amount by which to advance X when error term turns over */
	sbyte TopToBottom; /* 1 if this edge ran top to bottom as found in the vertex
					  list, -1 for bottom to top (used for winding rule) */
	byte (*StepVector)(struct _lineEdgeV *);	/* address of routine to use to step the edge
							(ignored for hardwired lines) */
	long countNumber;		/* 0 if this is a 0-count edge, 1 if it's a 1-count edge.
							Used only for double winding rule scanning */
	long WholePixelXMoveV;	/* minimum amount to advance X by from one scan line
							to the next */
	long ErrorTermV;		/* just what it says */
	long ErrorTermAdjUpV;	/* amount to add to error term from one line to the next */
	long ErrorTermAdjDownV;	/* amount to subtract from error term when it turns over */
} lineEdgeV;


/* Variables used by the rect routines */

extern rect rXmin;					/* temporary rectangle */
extern short rXWidth;				/* rectangle width */
extern short rXHeight;				/* rectangle height */
extern qarcState qaEdgeBuffer[13];	/* edge buffer */
extern qarcState *GETPtr;			/* pointer to global edge table */
extern lineEdgeV *tmpAETPtr;		/* pointer to active edge table */
extern lineEdgeV *leGETPtr;		/* pointer to line edge table */
extern short argDiaX;				/* round rectangle diameters */
extern short argDiaY;
extern int xRadius;
extern int yRadius;
extern short nextTopEdge;
extern short nextBottomEdge;
extern short thisLeftEdge;
extern short thisRightEdge;
extern short vertDirection;

#define fillRcdSize (sizeof(blitRcd) + 4*sizeof(rect))
extern byte rFillRcd[fillRcdSize];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -