📄 list0.c
字号:
/*************************************************************************/
/* */
/* 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 */
/* */
/* LIST0.c 1.9 */
/* */
/* COMPONENT */
/* */
/* All */
/* */
/* DESCRIPTION */
/* */
/* This file contains the mwRectInList function. */
/* */
/* AUTHOR */
/* */
/* Robert G. Burrill, Accelerated Technology, Inc. */
/* */
/* DATA STRUCTURES */
/* */
/* None */
/* */
/* FUNCTIONS */
/* */
/* None */
/* */
/* DEPENDENCIES */
/* */
/* None */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
#include "meta_wnd.h"
#include "metconst.h" /* MetaWINDOW Constant & Stucture Definitions */
#include "metports.h" /* MetaWINDOW Port & Bitmap Definitions */
#include "grafdata.h"
/* This function replaces the filler during "PtIn/On" type operations. It
obtains the rectangle to test against from grafdata, and places the result
there. Since a given function may call the filler multiple times, the filler
will increment the return value upon a "hit". A 0 is used to indicate the
starting value of "not in list". Should any part of the rectangle be in the
list, a hit is tallied. Notice that the test logic is backwards, ie it's
more likely to NOT be in the rect, so we try to stop testing soonest. */
void mwRectInList(blitRcd *FillRcd)
{
int numRect;
rect *pntrRect;
if(PtRslt == 1) return; /* check hit counter; return if already found one */
numRect = FillRcd->blitCnt; /* how many rects in list */
pntrRect = (rect *) FillRcd->blitList; /* get pointer to rect list */
while (numRect > 0) /* skip if list is empty */
{
numRect--;
if((pntrRect->Ymin < PtTstR.Ymax) && (pntrRect->Ymax > PtTstR.Ymin) &&
(pntrRect->Xmin < PtTstR.Xmax) && (pntrRect->Xmax > PtTstR.Xmin))
{
PtRslt = 1; /* set hit counter */
return;
}
pntrRect++; /* check next rectangle in list */
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -